1#![allow(non_camel_case_types)]
6#![allow(non_snake_case)]
7#![allow(non_upper_case_globals)]
8
9pub const CUDNN_MAJOR: u32 = 8;
10pub const CUDNN_MINOR: u32 = 2;
11pub const CUDNN_PATCHLEVEL: u32 = 2;
12pub const CUDNN_VERSION: u32 = 8202;
13pub const CUDNN_OPS_INFER_MAJOR: u32 = 8;
14pub const CUDNN_OPS_INFER_MINOR: u32 = 2;
15pub const CUDNN_OPS_INFER_PATCH: u32 = 2;
16pub const CUDNN_DIM_MAX: u32 = 8;
17pub const CUDNN_LRN_MIN_N: u32 = 1;
18pub const CUDNN_LRN_MAX_N: u32 = 16;
19pub const CUDNN_LRN_MIN_K: f64 = 0.00001;
20pub const CUDNN_LRN_MIN_BETA: f64 = 0.01;
21pub const CUDNN_BN_MIN_EPSILON: f64 = 0.0;
22pub const CUDNN_OPS_TRAIN_MAJOR: u32 = 8;
23pub const CUDNN_OPS_TRAIN_MINOR: u32 = 2;
24pub const CUDNN_OPS_TRAIN_PATCH: u32 = 2;
25pub const CUDNN_ADV_INFER_MAJOR: u32 = 8;
26pub const CUDNN_ADV_INFER_MINOR: u32 = 2;
27pub const CUDNN_ADV_INFER_PATCH: u32 = 2;
28pub const CUDNN_RNN_PADDED_IO_DISABLED: u32 = 0;
29pub const CUDNN_RNN_PADDED_IO_ENABLED: u32 = 1;
30pub const CUDNN_SEQDATA_DIM_COUNT: u32 = 4;
31pub const CUDNN_ATTN_QUERYMAP_ALL_TO_ONE: u32 = 0;
32pub const CUDNN_ATTN_QUERYMAP_ONE_TO_ONE: u32 = 1;
33pub const CUDNN_ATTN_DISABLE_PROJ_BIASES: u32 = 0;
34pub const CUDNN_ATTN_ENABLE_PROJ_BIASES: u32 = 2;
35pub const CUDNN_ATTN_WKIND_COUNT: u32 = 8;
36pub const CUDNN_ADV_TRAIN_MAJOR: u32 = 8;
37pub const CUDNN_ADV_TRAIN_MINOR: u32 = 2;
38pub const CUDNN_ADV_TRAIN_PATCH: u32 = 2;
39pub const CUDNN_CNN_INFER_MAJOR: u32 = 8;
40pub const CUDNN_CNN_INFER_MINOR: u32 = 2;
41pub const CUDNN_CNN_INFER_PATCH: u32 = 2;
42pub const CUDNN_CNN_TRAIN_MAJOR: u32 = 8;
43pub const CUDNN_CNN_TRAIN_MINOR: u32 = 2;
44pub const CUDNN_CNN_TRAIN_PATCH: u32 = 2;
45#[repr(u32)]
46#[non_exhaustive]
47#[doc = " *"]
48#[doc = " *"]
49#[doc = " *"]
50#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
51pub enum cudaRoundMode {
52 cudaRoundNearest = 0,
53 cudaRoundZero = 1,
54 cudaRoundPosInf = 2,
55 cudaRoundMinInf = 3,
56}
57#[doc = " *"]
58#[doc = " *"]
59#[doc = " *"]
60#[repr(C)]
61#[derive(Debug, Copy, Clone)]
62pub struct dim3 {
63 pub x: ::libc::c_uint,
64 pub y: ::libc::c_uint,
65 pub z: ::libc::c_uint,
66}
67#[test]
68fn bindgen_test_layout_dim3() {
69 assert_eq!(
70 ::std::mem::size_of::<dim3>(),
71 12usize,
72 concat!("Size of: ", stringify!(dim3))
73 );
74 assert_eq!(
75 ::std::mem::align_of::<dim3>(),
76 4usize,
77 concat!("Alignment of ", stringify!(dim3))
78 );
79 assert_eq!(
80 unsafe { &(*(::std::ptr::null::<dim3>())).x as *const _ as usize },
81 0usize,
82 concat!("Offset of field: ", stringify!(dim3), "::", stringify!(x))
83 );
84 assert_eq!(
85 unsafe { &(*(::std::ptr::null::<dim3>())).y as *const _ as usize },
86 4usize,
87 concat!("Offset of field: ", stringify!(dim3), "::", stringify!(y))
88 );
89 assert_eq!(
90 unsafe { &(*(::std::ptr::null::<dim3>())).z as *const _ as usize },
91 8usize,
92 concat!("Offset of field: ", stringify!(dim3), "::", stringify!(z))
93 );
94}
95#[repr(u32)]
96#[non_exhaustive]
97#[doc = " CUDA error types"]
98#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
99pub enum cudaError {
100 #[doc = " The API call returned with no errors. In the case of query calls, this"]
101 #[doc = " also means that the operation being queried is complete (see"]
102 #[doc = " ::cudaEventQuery() and ::cudaStreamQuery())."]
103 cudaSuccess = 0,
104 #[doc = " This indicates that one or more of the parameters passed to the API call"]
105 #[doc = " is not within an acceptable range of values."]
106 cudaErrorInvalidValue = 1,
107 #[doc = " The API call failed because it was unable to allocate enough memory to"]
108 #[doc = " perform the requested operation."]
109 cudaErrorMemoryAllocation = 2,
110 #[doc = " The API call failed because the CUDA driver and runtime could not be"]
111 #[doc = " initialized."]
112 cudaErrorInitializationError = 3,
113 #[doc = " This indicates that a CUDA Runtime API call cannot be executed because"]
114 #[doc = " it is being called during process shut down, at a point in time after"]
115 #[doc = " CUDA driver has been unloaded."]
116 cudaErrorCudartUnloading = 4,
117 #[doc = " This indicates profiler is not initialized for this run. This can"]
118 #[doc = " happen when the application is running with external profiling tools"]
119 #[doc = " like visual profiler."]
120 cudaErrorProfilerDisabled = 5,
121 #[doc = " \\deprecated"]
122 #[doc = " This error return is deprecated as of CUDA 5.0. It is no longer an error"]
123 #[doc = " to attempt to enable/disable the profiling via ::cudaProfilerStart or"]
124 #[doc = " ::cudaProfilerStop without initialization."]
125 cudaErrorProfilerNotInitialized = 6,
126 #[doc = " \\deprecated"]
127 #[doc = " This error return is deprecated as of CUDA 5.0. It is no longer an error"]
128 #[doc = " to call cudaProfilerStart() when profiling is already enabled."]
129 cudaErrorProfilerAlreadyStarted = 7,
130 #[doc = " \\deprecated"]
131 #[doc = " This error return is deprecated as of CUDA 5.0. It is no longer an error"]
132 #[doc = " to call cudaProfilerStop() when profiling is already disabled."]
133 cudaErrorProfilerAlreadyStopped = 8,
134 #[doc = " This indicates that a kernel launch is requesting resources that can"]
135 #[doc = " never be satisfied by the current device. Requesting more shared memory"]
136 #[doc = " per block than the device supports will trigger this error, as will"]
137 #[doc = " requesting too many threads or blocks. See ::cudaDeviceProp for more"]
138 #[doc = " device limitations."]
139 cudaErrorInvalidConfiguration = 9,
140 #[doc = " This indicates that one or more of the pitch-related parameters passed"]
141 #[doc = " to the API call is not within the acceptable range for pitch."]
142 cudaErrorInvalidPitchValue = 12,
143 #[doc = " This indicates that the symbol name/identifier passed to the API call"]
144 #[doc = " is not a valid name or identifier."]
145 cudaErrorInvalidSymbol = 13,
146 #[doc = " This indicates that at least one host pointer passed to the API call is"]
147 #[doc = " not a valid host pointer."]
148 #[doc = " \\deprecated"]
149 #[doc = " This error return is deprecated as of CUDA 10.1."]
150 cudaErrorInvalidHostPointer = 16,
151 #[doc = " This indicates that at least one device pointer passed to the API call is"]
152 #[doc = " not a valid device pointer."]
153 #[doc = " \\deprecated"]
154 #[doc = " This error return is deprecated as of CUDA 10.1."]
155 cudaErrorInvalidDevicePointer = 17,
156 #[doc = " This indicates that the texture passed to the API call is not a valid"]
157 #[doc = " texture."]
158 cudaErrorInvalidTexture = 18,
159 #[doc = " This indicates that the texture binding is not valid. This occurs if you"]
160 #[doc = " call ::cudaGetTextureAlignmentOffset() with an unbound texture."]
161 cudaErrorInvalidTextureBinding = 19,
162 #[doc = " This indicates that the channel descriptor passed to the API call is not"]
163 #[doc = " valid. This occurs if the format is not one of the formats specified by"]
164 #[doc = " ::cudaChannelFormatKind, or if one of the dimensions is invalid."]
165 cudaErrorInvalidChannelDescriptor = 20,
166 #[doc = " This indicates that the direction of the memcpy passed to the API call is"]
167 #[doc = " not one of the types specified by ::cudaMemcpyKind."]
168 cudaErrorInvalidMemcpyDirection = 21,
169 #[doc = " This indicated that the user has taken the address of a constant variable,"]
170 #[doc = " which was forbidden up until the CUDA 3.1 release."]
171 #[doc = " \\deprecated"]
172 #[doc = " This error return is deprecated as of CUDA 3.1. Variables in constant"]
173 #[doc = " memory may now have their address taken by the runtime via"]
174 #[doc = " ::cudaGetSymbolAddress()."]
175 cudaErrorAddressOfConstant = 22,
176 #[doc = " This indicated that a texture fetch was not able to be performed."]
177 #[doc = " This was previously used for device emulation of texture operations."]
178 #[doc = " \\deprecated"]
179 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
180 #[doc = " removed with the CUDA 3.1 release."]
181 cudaErrorTextureFetchFailed = 23,
182 #[doc = " This indicated that a texture was not bound for access."]
183 #[doc = " This was previously used for device emulation of texture operations."]
184 #[doc = " \\deprecated"]
185 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
186 #[doc = " removed with the CUDA 3.1 release."]
187 cudaErrorTextureNotBound = 24,
188 #[doc = " This indicated that a synchronization operation had failed."]
189 #[doc = " This was previously used for some device emulation functions."]
190 #[doc = " \\deprecated"]
191 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
192 #[doc = " removed with the CUDA 3.1 release."]
193 cudaErrorSynchronizationError = 25,
194 #[doc = " This indicates that a non-float texture was being accessed with linear"]
195 #[doc = " filtering. This is not supported by CUDA."]
196 cudaErrorInvalidFilterSetting = 26,
197 #[doc = " This indicates that an attempt was made to read a non-float texture as a"]
198 #[doc = " normalized float. This is not supported by CUDA."]
199 cudaErrorInvalidNormSetting = 27,
200 #[doc = " Mixing of device and device emulation code was not allowed."]
201 #[doc = " \\deprecated"]
202 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
203 #[doc = " removed with the CUDA 3.1 release."]
204 cudaErrorMixedDeviceExecution = 28,
205 #[doc = " This indicates that the API call is not yet implemented. Production"]
206 #[doc = " releases of CUDA will never return this error."]
207 #[doc = " \\deprecated"]
208 #[doc = " This error return is deprecated as of CUDA 4.1."]
209 cudaErrorNotYetImplemented = 31,
210 #[doc = " This indicated that an emulated device pointer exceeded the 32-bit address"]
211 #[doc = " range."]
212 #[doc = " \\deprecated"]
213 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
214 #[doc = " removed with the CUDA 3.1 release."]
215 cudaErrorMemoryValueTooLarge = 32,
216 #[doc = " This indicates that the CUDA driver that the application has loaded is a"]
217 #[doc = " stub library. Applications that run with the stub rather than a real"]
218 #[doc = " driver loaded will result in CUDA API returning this error."]
219 cudaErrorStubLibrary = 34,
220 #[doc = " This indicates that the installed NVIDIA CUDA driver is older than the"]
221 #[doc = " CUDA runtime library. This is not a supported configuration. Users should"]
222 #[doc = " install an updated NVIDIA display driver to allow the application to run."]
223 cudaErrorInsufficientDriver = 35,
224 #[doc = " This indicates that the API call requires a newer CUDA driver than the one"]
225 #[doc = " currently installed. Users should install an updated NVIDIA CUDA driver"]
226 #[doc = " to allow the API call to succeed."]
227 cudaErrorCallRequiresNewerDriver = 36,
228 #[doc = " This indicates that the surface passed to the API call is not a valid"]
229 #[doc = " surface."]
230 cudaErrorInvalidSurface = 37,
231 #[doc = " This indicates that multiple global or constant variables (across separate"]
232 #[doc = " CUDA source files in the application) share the same string name."]
233 cudaErrorDuplicateVariableName = 43,
234 #[doc = " This indicates that multiple textures (across separate CUDA source"]
235 #[doc = " files in the application) share the same string name."]
236 cudaErrorDuplicateTextureName = 44,
237 #[doc = " This indicates that multiple surfaces (across separate CUDA source"]
238 #[doc = " files in the application) share the same string name."]
239 cudaErrorDuplicateSurfaceName = 45,
240 #[doc = " This indicates that all CUDA devices are busy or unavailable at the current"]
241 #[doc = " time. Devices are often busy/unavailable due to use of"]
242 #[doc = " ::cudaComputeModeExclusive, ::cudaComputeModeProhibited or when long"]
243 #[doc = " running CUDA kernels have filled up the GPU and are blocking new work"]
244 #[doc = " from starting. They can also be unavailable due to memory constraints"]
245 #[doc = " on a device that already has active CUDA work being performed."]
246 cudaErrorDevicesUnavailable = 46,
247 #[doc = " This indicates that the current context is not compatible with this"]
248 #[doc = " the CUDA Runtime. This can only occur if you are using CUDA"]
249 #[doc = " Runtime/Driver interoperability and have created an existing Driver"]
250 #[doc = " context using the driver API. The Driver context may be incompatible"]
251 #[doc = " either because the Driver context was created using an older version"]
252 #[doc = " of the API, because the Runtime API call expects a primary driver"]
253 #[doc = " context and the Driver context is not primary, or because the Driver"]
254 #[doc = " context has been destroyed. Please see \\ref CUDART_DRIVER \"Interactions"]
255 #[doc = " with the CUDA Driver API\" for more information."]
256 cudaErrorIncompatibleDriverContext = 49,
257 #[doc = " The device function being invoked (usually via ::cudaLaunchKernel()) was not"]
258 #[doc = " previously configured via the ::cudaConfigureCall() function."]
259 cudaErrorMissingConfiguration = 52,
260 #[doc = " This indicated that a previous kernel launch failed. This was previously"]
261 #[doc = " used for device emulation of kernel launches."]
262 #[doc = " \\deprecated"]
263 #[doc = " This error return is deprecated as of CUDA 3.1. Device emulation mode was"]
264 #[doc = " removed with the CUDA 3.1 release."]
265 cudaErrorPriorLaunchFailure = 53,
266 #[doc = " This error indicates that a device runtime grid launch did not occur"]
267 #[doc = " because the depth of the child grid would exceed the maximum supported"]
268 #[doc = " number of nested grid launches."]
269 cudaErrorLaunchMaxDepthExceeded = 65,
270 #[doc = " This error indicates that a grid launch did not occur because the kernel"]
271 #[doc = " uses file-scoped textures which are unsupported by the device runtime."]
272 #[doc = " Kernels launched via the device runtime only support textures created with"]
273 #[doc = " the Texture Object API's."]
274 cudaErrorLaunchFileScopedTex = 66,
275 #[doc = " This error indicates that a grid launch did not occur because the kernel"]
276 #[doc = " uses file-scoped surfaces which are unsupported by the device runtime."]
277 #[doc = " Kernels launched via the device runtime only support surfaces created with"]
278 #[doc = " the Surface Object API's."]
279 cudaErrorLaunchFileScopedSurf = 67,
280 #[doc = " This error indicates that a call to ::cudaDeviceSynchronize made from"]
281 #[doc = " the device runtime failed because the call was made at grid depth greater"]
282 #[doc = " than than either the default (2 levels of grids) or user specified device"]
283 #[doc = " limit ::cudaLimitDevRuntimeSyncDepth. To be able to synchronize on"]
284 #[doc = " launched grids at a greater depth successfully, the maximum nested"]
285 #[doc = " depth at which ::cudaDeviceSynchronize will be called must be specified"]
286 #[doc = " with the ::cudaLimitDevRuntimeSyncDepth limit to the ::cudaDeviceSetLimit"]
287 #[doc = " api before the host-side launch of a kernel using the device runtime."]
288 #[doc = " Keep in mind that additional levels of sync depth require the runtime"]
289 #[doc = " to reserve large amounts of device memory that cannot be used for"]
290 #[doc = " user allocations."]
291 cudaErrorSyncDepthExceeded = 68,
292 #[doc = " This error indicates that a device runtime grid launch failed because"]
293 #[doc = " the launch would exceed the limit ::cudaLimitDevRuntimePendingLaunchCount."]
294 #[doc = " For this launch to proceed successfully, ::cudaDeviceSetLimit must be"]
295 #[doc = " called to set the ::cudaLimitDevRuntimePendingLaunchCount to be higher"]
296 #[doc = " than the upper bound of outstanding launches that can be issued to the"]
297 #[doc = " device runtime. Keep in mind that raising the limit of pending device"]
298 #[doc = " runtime launches will require the runtime to reserve device memory that"]
299 #[doc = " cannot be used for user allocations."]
300 cudaErrorLaunchPendingCountExceeded = 69,
301 #[doc = " The requested device function does not exist or is not compiled for the"]
302 #[doc = " proper device architecture."]
303 cudaErrorInvalidDeviceFunction = 98,
304 #[doc = " This indicates that no CUDA-capable devices were detected by the installed"]
305 #[doc = " CUDA driver."]
306 cudaErrorNoDevice = 100,
307 #[doc = " This indicates that the device ordinal supplied by the user does not"]
308 #[doc = " correspond to a valid CUDA device or that the action requested is"]
309 #[doc = " invalid for the specified device."]
310 cudaErrorInvalidDevice = 101,
311 #[doc = " This indicates that the device doesn't have a valid Grid License."]
312 cudaErrorDeviceNotLicensed = 102,
313 #[doc = " By default, the CUDA runtime may perform a minimal set of self-tests,"]
314 #[doc = " as well as CUDA driver tests, to establish the validity of both."]
315 #[doc = " Introduced in CUDA 11.2, this error return indicates that at least one"]
316 #[doc = " of these tests has failed and the validity of either the runtime"]
317 #[doc = " or the driver could not be established."]
318 cudaErrorSoftwareValidityNotEstablished = 103,
319 #[doc = " This indicates an internal startup failure in the CUDA runtime."]
320 cudaErrorStartupFailure = 127,
321 #[doc = " This indicates that the device kernel image is invalid."]
322 cudaErrorInvalidKernelImage = 200,
323 #[doc = " This most frequently indicates that there is no context bound to the"]
324 #[doc = " current thread. This can also be returned if the context passed to an"]
325 #[doc = " API call is not a valid handle (such as a context that has had"]
326 #[doc = " ::cuCtxDestroy() invoked on it). This can also be returned if a user"]
327 #[doc = " mixes different API versions (i.e. 3010 context with 3020 API calls)."]
328 #[doc = " See ::cuCtxGetApiVersion() for more details."]
329 cudaErrorDeviceUninitialized = 201,
330 #[doc = " This indicates that the buffer object could not be mapped."]
331 cudaErrorMapBufferObjectFailed = 205,
332 #[doc = " This indicates that the buffer object could not be unmapped."]
333 cudaErrorUnmapBufferObjectFailed = 206,
334 #[doc = " This indicates that the specified array is currently mapped and thus"]
335 #[doc = " cannot be destroyed."]
336 cudaErrorArrayIsMapped = 207,
337 #[doc = " This indicates that the resource is already mapped."]
338 cudaErrorAlreadyMapped = 208,
339 #[doc = " This indicates that there is no kernel image available that is suitable"]
340 #[doc = " for the device. This can occur when a user specifies code generation"]
341 #[doc = " options for a particular CUDA source file that do not include the"]
342 #[doc = " corresponding device configuration."]
343 cudaErrorNoKernelImageForDevice = 209,
344 #[doc = " This indicates that a resource has already been acquired."]
345 cudaErrorAlreadyAcquired = 210,
346 #[doc = " This indicates that a resource is not mapped."]
347 cudaErrorNotMapped = 211,
348 #[doc = " This indicates that a mapped resource is not available for access as an"]
349 #[doc = " array."]
350 cudaErrorNotMappedAsArray = 212,
351 #[doc = " This indicates that a mapped resource is not available for access as a"]
352 #[doc = " pointer."]
353 cudaErrorNotMappedAsPointer = 213,
354 #[doc = " This indicates that an uncorrectable ECC error was detected during"]
355 #[doc = " execution."]
356 cudaErrorECCUncorrectable = 214,
357 #[doc = " This indicates that the ::cudaLimit passed to the API call is not"]
358 #[doc = " supported by the active device."]
359 cudaErrorUnsupportedLimit = 215,
360 #[doc = " This indicates that a call tried to access an exclusive-thread device that"]
361 #[doc = " is already in use by a different thread."]
362 cudaErrorDeviceAlreadyInUse = 216,
363 #[doc = " This error indicates that P2P access is not supported across the given"]
364 #[doc = " devices."]
365 cudaErrorPeerAccessUnsupported = 217,
366 #[doc = " A PTX compilation failed. The runtime may fall back to compiling PTX if"]
367 #[doc = " an application does not contain a suitable binary for the current device."]
368 cudaErrorInvalidPtx = 218,
369 #[doc = " This indicates an error with the OpenGL or DirectX context."]
370 cudaErrorInvalidGraphicsContext = 219,
371 #[doc = " This indicates that an uncorrectable NVLink error was detected during the"]
372 #[doc = " execution."]
373 cudaErrorNvlinkUncorrectable = 220,
374 #[doc = " This indicates that the PTX JIT compiler library was not found. The JIT Compiler"]
375 #[doc = " library is used for PTX compilation. The runtime may fall back to compiling PTX"]
376 #[doc = " if an application does not contain a suitable binary for the current device."]
377 cudaErrorJitCompilerNotFound = 221,
378 #[doc = " This indicates that the provided PTX was compiled with an unsupported toolchain."]
379 #[doc = " The most common reason for this, is the PTX was generated by a compiler newer"]
380 #[doc = " than what is supported by the CUDA driver and PTX JIT compiler."]
381 cudaErrorUnsupportedPtxVersion = 222,
382 #[doc = " This indicates that the JIT compilation was disabled. The JIT compilation compiles"]
383 #[doc = " PTX. The runtime may fall back to compiling PTX if an application does not contain"]
384 #[doc = " a suitable binary for the current device."]
385 cudaErrorJitCompilationDisabled = 223,
386 #[doc = " This indicates that the provided execution affinity is not supported by the device."]
387 cudaErrorUnsupportedExecAffinity = 224,
388 #[doc = " This indicates that the device kernel source is invalid."]
389 cudaErrorInvalidSource = 300,
390 #[doc = " This indicates that the file specified was not found."]
391 cudaErrorFileNotFound = 301,
392 #[doc = " This indicates that a link to a shared object failed to resolve."]
393 cudaErrorSharedObjectSymbolNotFound = 302,
394 #[doc = " This indicates that initialization of a shared object failed."]
395 cudaErrorSharedObjectInitFailed = 303,
396 #[doc = " This error indicates that an OS call failed."]
397 cudaErrorOperatingSystem = 304,
398 #[doc = " This indicates that a resource handle passed to the API call was not"]
399 #[doc = " valid. Resource handles are opaque types like ::cudaStream_t and"]
400 #[doc = " ::cudaEvent_t."]
401 cudaErrorInvalidResourceHandle = 400,
402 #[doc = " This indicates that a resource required by the API call is not in a"]
403 #[doc = " valid state to perform the requested operation."]
404 cudaErrorIllegalState = 401,
405 #[doc = " This indicates that a named symbol was not found. Examples of symbols"]
406 #[doc = " are global/constant variable names, driver function names, texture names,"]
407 #[doc = " and surface names."]
408 cudaErrorSymbolNotFound = 500,
409 #[doc = " This indicates that asynchronous operations issued previously have not"]
410 #[doc = " completed yet. This result is not actually an error, but must be indicated"]
411 #[doc = " differently than ::cudaSuccess (which indicates completion). Calls that"]
412 #[doc = " may return this value include ::cudaEventQuery() and ::cudaStreamQuery()."]
413 cudaErrorNotReady = 600,
414 #[doc = " The device encountered a load or store instruction on an invalid memory address."]
415 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
416 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
417 #[doc = " and relaunched."]
418 cudaErrorIllegalAddress = 700,
419 #[doc = " This indicates that a launch did not occur because it did not have"]
420 #[doc = " appropriate resources. Although this error is similar to"]
421 #[doc = " ::cudaErrorInvalidConfiguration, this error usually indicates that the"]
422 #[doc = " user has attempted to pass too many arguments to the device kernel, or the"]
423 #[doc = " kernel launch specifies too many threads for the kernel's register count."]
424 cudaErrorLaunchOutOfResources = 701,
425 #[doc = " This indicates that the device kernel took too long to execute. This can"]
426 #[doc = " only occur if timeouts are enabled - see the device property"]
427 #[doc = " \\ref ::cudaDeviceProp::kernelExecTimeoutEnabled \"kernelExecTimeoutEnabled\""]
428 #[doc = " for more information."]
429 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
430 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
431 #[doc = " and relaunched."]
432 cudaErrorLaunchTimeout = 702,
433 #[doc = " This error indicates a kernel launch that uses an incompatible texturing"]
434 #[doc = " mode."]
435 cudaErrorLaunchIncompatibleTexturing = 703,
436 #[doc = " This error indicates that a call to ::cudaDeviceEnablePeerAccess() is"]
437 #[doc = " trying to re-enable peer addressing on from a context which has already"]
438 #[doc = " had peer addressing enabled."]
439 cudaErrorPeerAccessAlreadyEnabled = 704,
440 #[doc = " This error indicates that ::cudaDeviceDisablePeerAccess() is trying to"]
441 #[doc = " disable peer addressing which has not been enabled yet via"]
442 #[doc = " ::cudaDeviceEnablePeerAccess()."]
443 cudaErrorPeerAccessNotEnabled = 705,
444 #[doc = " This indicates that the user has called ::cudaSetValidDevices(),"]
445 #[doc = " ::cudaSetDeviceFlags(), ::cudaD3D9SetDirect3DDevice(),"]
446 #[doc = " ::cudaD3D10SetDirect3DDevice, ::cudaD3D11SetDirect3DDevice(), or"]
447 #[doc = " ::cudaVDPAUSetVDPAUDevice() after initializing the CUDA runtime by"]
448 #[doc = " calling non-device management operations (allocating memory and"]
449 #[doc = " launching kernels are examples of non-device management operations)."]
450 #[doc = " This error can also be returned if using runtime/driver"]
451 #[doc = " interoperability and there is an existing ::CUcontext active on the"]
452 #[doc = " host thread."]
453 cudaErrorSetOnActiveProcess = 708,
454 #[doc = " This error indicates that the context current to the calling thread"]
455 #[doc = " has been destroyed using ::cuCtxDestroy, or is a primary context which"]
456 #[doc = " has not yet been initialized."]
457 cudaErrorContextIsDestroyed = 709,
458 #[doc = " An assert triggered in device code during kernel execution. The device"]
459 #[doc = " cannot be used again. All existing allocations are invalid. To continue"]
460 #[doc = " using CUDA, the process must be terminated and relaunched."]
461 cudaErrorAssert = 710,
462 #[doc = " This error indicates that the hardware resources required to enable"]
463 #[doc = " peer access have been exhausted for one or more of the devices"]
464 #[doc = " passed to ::cudaEnablePeerAccess()."]
465 cudaErrorTooManyPeers = 711,
466 #[doc = " This error indicates that the memory range passed to ::cudaHostRegister()"]
467 #[doc = " has already been registered."]
468 cudaErrorHostMemoryAlreadyRegistered = 712,
469 #[doc = " This error indicates that the pointer passed to ::cudaHostUnregister()"]
470 #[doc = " does not correspond to any currently registered memory region."]
471 cudaErrorHostMemoryNotRegistered = 713,
472 #[doc = " Device encountered an error in the call stack during kernel execution,"]
473 #[doc = " possibly due to stack corruption or exceeding the stack size limit."]
474 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
475 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
476 #[doc = " and relaunched."]
477 cudaErrorHardwareStackError = 714,
478 #[doc = " The device encountered an illegal instruction during kernel execution"]
479 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
480 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
481 #[doc = " and relaunched."]
482 cudaErrorIllegalInstruction = 715,
483 #[doc = " The device encountered a load or store instruction"]
484 #[doc = " on a memory address which is not aligned."]
485 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
486 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
487 #[doc = " and relaunched."]
488 cudaErrorMisalignedAddress = 716,
489 #[doc = " While executing a kernel, the device encountered an instruction"]
490 #[doc = " which can only operate on memory locations in certain address spaces"]
491 #[doc = " (global, shared, or local), but was supplied a memory address not"]
492 #[doc = " belonging to an allowed address space."]
493 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
494 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
495 #[doc = " and relaunched."]
496 cudaErrorInvalidAddressSpace = 717,
497 #[doc = " The device encountered an invalid program counter."]
498 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
499 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
500 #[doc = " and relaunched."]
501 cudaErrorInvalidPc = 718,
502 #[doc = " An exception occurred on the device while executing a kernel. Common"]
503 #[doc = " causes include dereferencing an invalid device pointer and accessing"]
504 #[doc = " out of bounds shared memory. Less common cases can be system specific - more"]
505 #[doc = " information about these cases can be found in the system specific user guide."]
506 #[doc = " This leaves the process in an inconsistent state and any further CUDA work"]
507 #[doc = " will return the same error. To continue using CUDA, the process must be terminated"]
508 #[doc = " and relaunched."]
509 cudaErrorLaunchFailure = 719,
510 #[doc = " This error indicates that the number of blocks launched per grid for a kernel that was"]
511 #[doc = " launched via either ::cudaLaunchCooperativeKernel or ::cudaLaunchCooperativeKernelMultiDevice"]
512 #[doc = " exceeds the maximum number of blocks as allowed by ::cudaOccupancyMaxActiveBlocksPerMultiprocessor"]
513 #[doc = " or ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors"]
514 #[doc = " as specified by the device attribute ::cudaDevAttrMultiProcessorCount."]
515 cudaErrorCooperativeLaunchTooLarge = 720,
516 #[doc = " This error indicates the attempted operation is not permitted."]
517 cudaErrorNotPermitted = 800,
518 #[doc = " This error indicates the attempted operation is not supported"]
519 #[doc = " on the current system or device."]
520 cudaErrorNotSupported = 801,
521 #[doc = " This error indicates that the system is not yet ready to start any CUDA"]
522 #[doc = " work. To continue using CUDA, verify the system configuration is in a"]
523 #[doc = " valid state and all required driver daemons are actively running."]
524 #[doc = " More information about this error can be found in the system specific"]
525 #[doc = " user guide."]
526 cudaErrorSystemNotReady = 802,
527 #[doc = " This error indicates that there is a mismatch between the versions of"]
528 #[doc = " the display driver and the CUDA driver. Refer to the compatibility documentation"]
529 #[doc = " for supported versions."]
530 cudaErrorSystemDriverMismatch = 803,
531 #[doc = " This error indicates that the system was upgraded to run with forward compatibility"]
532 #[doc = " but the visible hardware detected by CUDA does not support this configuration."]
533 #[doc = " Refer to the compatibility documentation for the supported hardware matrix or ensure"]
534 #[doc = " that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES"]
535 #[doc = " environment variable."]
536 cudaErrorCompatNotSupportedOnDevice = 804,
537 #[doc = " This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server."]
538 cudaErrorMpsConnectionFailed = 805,
539 #[doc = " This error indicates that the remote procedural call between the MPS server and the MPS client failed."]
540 cudaErrorMpsRpcFailure = 806,
541 #[doc = " This error indicates that the MPS server is not ready to accept new MPS client requests."]
542 #[doc = " This error can be returned when the MPS server is in the process of recovering from a fatal failure."]
543 cudaErrorMpsServerNotReady = 807,
544 #[doc = " This error indicates that the hardware resources required to create MPS client have been exhausted."]
545 cudaErrorMpsMaxClientsReached = 808,
546 #[doc = " This error indicates the the hardware resources required to device connections have been exhausted."]
547 cudaErrorMpsMaxConnectionsReached = 809,
548 #[doc = " The operation is not permitted when the stream is capturing."]
549 cudaErrorStreamCaptureUnsupported = 900,
550 #[doc = " The current capture sequence on the stream has been invalidated due to"]
551 #[doc = " a previous error."]
552 cudaErrorStreamCaptureInvalidated = 901,
553 #[doc = " The operation would have resulted in a merge of two independent capture"]
554 #[doc = " sequences."]
555 cudaErrorStreamCaptureMerge = 902,
556 #[doc = " The capture was not initiated in this stream."]
557 cudaErrorStreamCaptureUnmatched = 903,
558 #[doc = " The capture sequence contains a fork that was not joined to the primary"]
559 #[doc = " stream."]
560 cudaErrorStreamCaptureUnjoined = 904,
561 #[doc = " A dependency would have been created which crosses the capture sequence"]
562 #[doc = " boundary. Only implicit in-stream ordering dependencies are allowed to"]
563 #[doc = " cross the boundary."]
564 cudaErrorStreamCaptureIsolation = 905,
565 #[doc = " The operation would have resulted in a disallowed implicit dependency on"]
566 #[doc = " a current capture sequence from cudaStreamLegacy."]
567 cudaErrorStreamCaptureImplicit = 906,
568 #[doc = " The operation is not permitted on an event which was last recorded in a"]
569 #[doc = " capturing stream."]
570 cudaErrorCapturedEvent = 907,
571 #[doc = " A stream capture sequence not initiated with the ::cudaStreamCaptureModeRelaxed"]
572 #[doc = " argument to ::cudaStreamBeginCapture was passed to ::cudaStreamEndCapture in a"]
573 #[doc = " different thread."]
574 cudaErrorStreamCaptureWrongThread = 908,
575 #[doc = " This indicates that the wait operation has timed out."]
576 cudaErrorTimeout = 909,
577 #[doc = " This error indicates that the graph update was not performed because it included"]
578 #[doc = " changes which violated constraints specific to instantiated graph update."]
579 cudaErrorGraphExecUpdateFailure = 910,
580 #[doc = " This indicates that an unknown internal error has occurred."]
581 cudaErrorUnknown = 999,
582 #[doc = " Any unhandled CUDA driver error is added to this value and returned via"]
583 #[doc = " the runtime. Production releases of CUDA should not return such errors."]
584 #[doc = " \\deprecated"]
585 #[doc = " This error return is deprecated as of CUDA 4.1."]
586 cudaErrorApiFailureBase = 10000,
587}
588#[repr(u32)]
589#[non_exhaustive]
590#[doc = " Channel format kind"]
591#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
592pub enum cudaChannelFormatKind {
593 #[doc = "< Signed channel format"]
594 cudaChannelFormatKindSigned = 0,
595 #[doc = "< Unsigned channel format"]
596 cudaChannelFormatKindUnsigned = 1,
597 #[doc = "< Float channel format"]
598 cudaChannelFormatKindFloat = 2,
599 #[doc = "< No channel format"]
600 cudaChannelFormatKindNone = 3,
601 cudaChannelFormatKindNV12 = 4,
602}
603#[doc = " CUDA Channel format descriptor"]
604#[repr(C)]
605#[derive(Debug, Copy, Clone)]
606pub struct cudaChannelFormatDesc {
607 #[doc = "< x"]
608 pub x: ::libc::c_int,
609 #[doc = "< y"]
610 pub y: ::libc::c_int,
611 #[doc = "< z"]
612 pub z: ::libc::c_int,
613 #[doc = "< w"]
614 pub w: ::libc::c_int,
615 #[doc = "< Channel format kind"]
616 pub f: cudaChannelFormatKind,
617}
618#[test]
619fn bindgen_test_layout_cudaChannelFormatDesc() {
620 assert_eq!(
621 ::std::mem::size_of::<cudaChannelFormatDesc>(),
622 20usize,
623 concat!("Size of: ", stringify!(cudaChannelFormatDesc))
624 );
625 assert_eq!(
626 ::std::mem::align_of::<cudaChannelFormatDesc>(),
627 4usize,
628 concat!("Alignment of ", stringify!(cudaChannelFormatDesc))
629 );
630 assert_eq!(
631 unsafe { &(*(::std::ptr::null::<cudaChannelFormatDesc>())).x as *const _ as usize },
632 0usize,
633 concat!(
634 "Offset of field: ",
635 stringify!(cudaChannelFormatDesc),
636 "::",
637 stringify!(x)
638 )
639 );
640 assert_eq!(
641 unsafe { &(*(::std::ptr::null::<cudaChannelFormatDesc>())).y as *const _ as usize },
642 4usize,
643 concat!(
644 "Offset of field: ",
645 stringify!(cudaChannelFormatDesc),
646 "::",
647 stringify!(y)
648 )
649 );
650 assert_eq!(
651 unsafe { &(*(::std::ptr::null::<cudaChannelFormatDesc>())).z as *const _ as usize },
652 8usize,
653 concat!(
654 "Offset of field: ",
655 stringify!(cudaChannelFormatDesc),
656 "::",
657 stringify!(z)
658 )
659 );
660 assert_eq!(
661 unsafe { &(*(::std::ptr::null::<cudaChannelFormatDesc>())).w as *const _ as usize },
662 12usize,
663 concat!(
664 "Offset of field: ",
665 stringify!(cudaChannelFormatDesc),
666 "::",
667 stringify!(w)
668 )
669 );
670 assert_eq!(
671 unsafe { &(*(::std::ptr::null::<cudaChannelFormatDesc>())).f as *const _ as usize },
672 16usize,
673 concat!(
674 "Offset of field: ",
675 stringify!(cudaChannelFormatDesc),
676 "::",
677 stringify!(f)
678 )
679 );
680}
681#[repr(C)]
682#[derive(Debug, Copy, Clone)]
683pub struct cudaArray {
684 _unused: [u8; 0],
685}
686#[doc = " CUDA array"]
687pub type cudaArray_t = *mut cudaArray;
688#[doc = " CUDA array (as source copy argument)"]
689pub type cudaArray_const_t = *const cudaArray;
690#[repr(C)]
691#[derive(Debug, Copy, Clone)]
692pub struct cudaMipmappedArray {
693 _unused: [u8; 0],
694}
695#[doc = " CUDA mipmapped array"]
696pub type cudaMipmappedArray_t = *mut cudaMipmappedArray;
697#[doc = " CUDA mipmapped array (as source argument)"]
698pub type cudaMipmappedArray_const_t = *const cudaMipmappedArray;
699#[doc = " Sparse CUDA array and CUDA mipmapped array properties"]
700#[repr(C)]
701#[derive(Debug, Copy, Clone)]
702pub struct cudaArraySparseProperties {
703 pub tileExtent: cudaArraySparseProperties__bindgen_ty_1,
704 #[doc = "< First mip level at which the mip tail begins"]
705 pub miptailFirstLevel: ::libc::c_uint,
706 #[doc = "< Total size of the mip tail."]
707 pub miptailSize: ::libc::c_ulonglong,
708 #[doc = "< Flags will either be zero or ::cudaArraySparsePropertiesSingleMipTail"]
709 pub flags: ::libc::c_uint,
710 pub reserved: [::libc::c_uint; 4usize],
711}
712#[repr(C)]
713#[derive(Debug, Copy, Clone)]
714pub struct cudaArraySparseProperties__bindgen_ty_1 {
715 #[doc = "< Tile width in elements"]
716 pub width: ::libc::c_uint,
717 #[doc = "< Tile height in elements"]
718 pub height: ::libc::c_uint,
719 #[doc = "< Tile depth in elements"]
720 pub depth: ::libc::c_uint,
721}
722#[test]
723fn bindgen_test_layout_cudaArraySparseProperties__bindgen_ty_1() {
724 assert_eq!(
725 ::std::mem::size_of::<cudaArraySparseProperties__bindgen_ty_1>(),
726 12usize,
727 concat!(
728 "Size of: ",
729 stringify!(cudaArraySparseProperties__bindgen_ty_1)
730 )
731 );
732 assert_eq!(
733 ::std::mem::align_of::<cudaArraySparseProperties__bindgen_ty_1>(),
734 4usize,
735 concat!(
736 "Alignment of ",
737 stringify!(cudaArraySparseProperties__bindgen_ty_1)
738 )
739 );
740 assert_eq!(
741 unsafe {
742 &(*(::std::ptr::null::<cudaArraySparseProperties__bindgen_ty_1>())).width as *const _
743 as usize
744 },
745 0usize,
746 concat!(
747 "Offset of field: ",
748 stringify!(cudaArraySparseProperties__bindgen_ty_1),
749 "::",
750 stringify!(width)
751 )
752 );
753 assert_eq!(
754 unsafe {
755 &(*(::std::ptr::null::<cudaArraySparseProperties__bindgen_ty_1>())).height as *const _
756 as usize
757 },
758 4usize,
759 concat!(
760 "Offset of field: ",
761 stringify!(cudaArraySparseProperties__bindgen_ty_1),
762 "::",
763 stringify!(height)
764 )
765 );
766 assert_eq!(
767 unsafe {
768 &(*(::std::ptr::null::<cudaArraySparseProperties__bindgen_ty_1>())).depth as *const _
769 as usize
770 },
771 8usize,
772 concat!(
773 "Offset of field: ",
774 stringify!(cudaArraySparseProperties__bindgen_ty_1),
775 "::",
776 stringify!(depth)
777 )
778 );
779}
780#[test]
781fn bindgen_test_layout_cudaArraySparseProperties() {
782 assert_eq!(
783 ::std::mem::size_of::<cudaArraySparseProperties>(),
784 48usize,
785 concat!("Size of: ", stringify!(cudaArraySparseProperties))
786 );
787 assert_eq!(
788 ::std::mem::align_of::<cudaArraySparseProperties>(),
789 8usize,
790 concat!("Alignment of ", stringify!(cudaArraySparseProperties))
791 );
792 assert_eq!(
793 unsafe {
794 &(*(::std::ptr::null::<cudaArraySparseProperties>())).tileExtent as *const _ as usize
795 },
796 0usize,
797 concat!(
798 "Offset of field: ",
799 stringify!(cudaArraySparseProperties),
800 "::",
801 stringify!(tileExtent)
802 )
803 );
804 assert_eq!(
805 unsafe {
806 &(*(::std::ptr::null::<cudaArraySparseProperties>())).miptailFirstLevel as *const _
807 as usize
808 },
809 12usize,
810 concat!(
811 "Offset of field: ",
812 stringify!(cudaArraySparseProperties),
813 "::",
814 stringify!(miptailFirstLevel)
815 )
816 );
817 assert_eq!(
818 unsafe {
819 &(*(::std::ptr::null::<cudaArraySparseProperties>())).miptailSize as *const _ as usize
820 },
821 16usize,
822 concat!(
823 "Offset of field: ",
824 stringify!(cudaArraySparseProperties),
825 "::",
826 stringify!(miptailSize)
827 )
828 );
829 assert_eq!(
830 unsafe { &(*(::std::ptr::null::<cudaArraySparseProperties>())).flags as *const _ as usize },
831 24usize,
832 concat!(
833 "Offset of field: ",
834 stringify!(cudaArraySparseProperties),
835 "::",
836 stringify!(flags)
837 )
838 );
839 assert_eq!(
840 unsafe {
841 &(*(::std::ptr::null::<cudaArraySparseProperties>())).reserved as *const _ as usize
842 },
843 28usize,
844 concat!(
845 "Offset of field: ",
846 stringify!(cudaArraySparseProperties),
847 "::",
848 stringify!(reserved)
849 )
850 );
851}
852#[repr(u32)]
853#[non_exhaustive]
854#[doc = " CUDA memory types"]
855#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
856pub enum cudaMemoryType {
857 #[doc = "< Unregistered memory"]
858 cudaMemoryTypeUnregistered = 0,
859 #[doc = "< Host memory"]
860 cudaMemoryTypeHost = 1,
861 #[doc = "< Device memory"]
862 cudaMemoryTypeDevice = 2,
863 #[doc = "< Managed memory"]
864 cudaMemoryTypeManaged = 3,
865}
866#[repr(u32)]
867#[non_exhaustive]
868#[doc = " CUDA memory copy types"]
869#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
870pub enum cudaMemcpyKind {
871 #[doc = "< Host -> Host"]
872 cudaMemcpyHostToHost = 0,
873 #[doc = "< Host -> Device"]
874 cudaMemcpyHostToDevice = 1,
875 #[doc = "< Device -> Host"]
876 cudaMemcpyDeviceToHost = 2,
877 #[doc = "< Device -> Device"]
878 cudaMemcpyDeviceToDevice = 3,
879 #[doc = "< Direction of the transfer is inferred from the pointer values. Requires unified virtual addressing"]
880 cudaMemcpyDefault = 4,
881}
882#[doc = " CUDA Pitched memory pointer"]
883#[doc = ""]
884#[doc = " \\sa ::make_cudaPitchedPtr"]
885#[repr(C)]
886#[derive(Debug, Copy, Clone)]
887pub struct cudaPitchedPtr {
888 #[doc = "< Pointer to allocated memory"]
889 pub ptr: *mut ::libc::c_void,
890 #[doc = "< Pitch of allocated memory in bytes"]
891 pub pitch: usize,
892 #[doc = "< Logical width of allocation in elements"]
893 pub xsize: usize,
894 #[doc = "< Logical height of allocation in elements"]
895 pub ysize: usize,
896}
897#[test]
898fn bindgen_test_layout_cudaPitchedPtr() {
899 assert_eq!(
900 ::std::mem::size_of::<cudaPitchedPtr>(),
901 32usize,
902 concat!("Size of: ", stringify!(cudaPitchedPtr))
903 );
904 assert_eq!(
905 ::std::mem::align_of::<cudaPitchedPtr>(),
906 8usize,
907 concat!("Alignment of ", stringify!(cudaPitchedPtr))
908 );
909 assert_eq!(
910 unsafe { &(*(::std::ptr::null::<cudaPitchedPtr>())).ptr as *const _ as usize },
911 0usize,
912 concat!(
913 "Offset of field: ",
914 stringify!(cudaPitchedPtr),
915 "::",
916 stringify!(ptr)
917 )
918 );
919 assert_eq!(
920 unsafe { &(*(::std::ptr::null::<cudaPitchedPtr>())).pitch as *const _ as usize },
921 8usize,
922 concat!(
923 "Offset of field: ",
924 stringify!(cudaPitchedPtr),
925 "::",
926 stringify!(pitch)
927 )
928 );
929 assert_eq!(
930 unsafe { &(*(::std::ptr::null::<cudaPitchedPtr>())).xsize as *const _ as usize },
931 16usize,
932 concat!(
933 "Offset of field: ",
934 stringify!(cudaPitchedPtr),
935 "::",
936 stringify!(xsize)
937 )
938 );
939 assert_eq!(
940 unsafe { &(*(::std::ptr::null::<cudaPitchedPtr>())).ysize as *const _ as usize },
941 24usize,
942 concat!(
943 "Offset of field: ",
944 stringify!(cudaPitchedPtr),
945 "::",
946 stringify!(ysize)
947 )
948 );
949}
950#[doc = " CUDA extent"]
951#[doc = ""]
952#[doc = " \\sa ::make_cudaExtent"]
953#[repr(C)]
954#[derive(Debug, Copy, Clone)]
955pub struct cudaExtent {
956 #[doc = "< Width in elements when referring to array memory, in bytes when referring to linear memory"]
957 pub width: usize,
958 #[doc = "< Height in elements"]
959 pub height: usize,
960 #[doc = "< Depth in elements"]
961 pub depth: usize,
962}
963#[test]
964fn bindgen_test_layout_cudaExtent() {
965 assert_eq!(
966 ::std::mem::size_of::<cudaExtent>(),
967 24usize,
968 concat!("Size of: ", stringify!(cudaExtent))
969 );
970 assert_eq!(
971 ::std::mem::align_of::<cudaExtent>(),
972 8usize,
973 concat!("Alignment of ", stringify!(cudaExtent))
974 );
975 assert_eq!(
976 unsafe { &(*(::std::ptr::null::<cudaExtent>())).width as *const _ as usize },
977 0usize,
978 concat!(
979 "Offset of field: ",
980 stringify!(cudaExtent),
981 "::",
982 stringify!(width)
983 )
984 );
985 assert_eq!(
986 unsafe { &(*(::std::ptr::null::<cudaExtent>())).height as *const _ as usize },
987 8usize,
988 concat!(
989 "Offset of field: ",
990 stringify!(cudaExtent),
991 "::",
992 stringify!(height)
993 )
994 );
995 assert_eq!(
996 unsafe { &(*(::std::ptr::null::<cudaExtent>())).depth as *const _ as usize },
997 16usize,
998 concat!(
999 "Offset of field: ",
1000 stringify!(cudaExtent),
1001 "::",
1002 stringify!(depth)
1003 )
1004 );
1005}
1006#[doc = " CUDA 3D position"]
1007#[doc = ""]
1008#[doc = " \\sa ::make_cudaPos"]
1009#[repr(C)]
1010#[derive(Debug, Copy, Clone)]
1011pub struct cudaPos {
1012 #[doc = "< x"]
1013 pub x: usize,
1014 #[doc = "< y"]
1015 pub y: usize,
1016 #[doc = "< z"]
1017 pub z: usize,
1018}
1019#[test]
1020fn bindgen_test_layout_cudaPos() {
1021 assert_eq!(
1022 ::std::mem::size_of::<cudaPos>(),
1023 24usize,
1024 concat!("Size of: ", stringify!(cudaPos))
1025 );
1026 assert_eq!(
1027 ::std::mem::align_of::<cudaPos>(),
1028 8usize,
1029 concat!("Alignment of ", stringify!(cudaPos))
1030 );
1031 assert_eq!(
1032 unsafe { &(*(::std::ptr::null::<cudaPos>())).x as *const _ as usize },
1033 0usize,
1034 concat!(
1035 "Offset of field: ",
1036 stringify!(cudaPos),
1037 "::",
1038 stringify!(x)
1039 )
1040 );
1041 assert_eq!(
1042 unsafe { &(*(::std::ptr::null::<cudaPos>())).y as *const _ as usize },
1043 8usize,
1044 concat!(
1045 "Offset of field: ",
1046 stringify!(cudaPos),
1047 "::",
1048 stringify!(y)
1049 )
1050 );
1051 assert_eq!(
1052 unsafe { &(*(::std::ptr::null::<cudaPos>())).z as *const _ as usize },
1053 16usize,
1054 concat!(
1055 "Offset of field: ",
1056 stringify!(cudaPos),
1057 "::",
1058 stringify!(z)
1059 )
1060 );
1061}
1062#[doc = " CUDA 3D memory copying parameters"]
1063#[repr(C)]
1064#[derive(Debug, Copy, Clone)]
1065pub struct cudaMemcpy3DParms {
1066 #[doc = "< Source memory address"]
1067 pub srcArray: cudaArray_t,
1068 #[doc = "< Source position offset"]
1069 pub srcPos: cudaPos,
1070 #[doc = "< Pitched source memory address"]
1071 pub srcPtr: cudaPitchedPtr,
1072 #[doc = "< Destination memory address"]
1073 pub dstArray: cudaArray_t,
1074 #[doc = "< Destination position offset"]
1075 pub dstPos: cudaPos,
1076 #[doc = "< Pitched destination memory address"]
1077 pub dstPtr: cudaPitchedPtr,
1078 #[doc = "< Requested memory copy size"]
1079 pub extent: cudaExtent,
1080 #[doc = "< Type of transfer"]
1081 pub kind: cudaMemcpyKind,
1082}
1083#[test]
1084fn bindgen_test_layout_cudaMemcpy3DParms() {
1085 assert_eq!(
1086 ::std::mem::size_of::<cudaMemcpy3DParms>(),
1087 160usize,
1088 concat!("Size of: ", stringify!(cudaMemcpy3DParms))
1089 );
1090 assert_eq!(
1091 ::std::mem::align_of::<cudaMemcpy3DParms>(),
1092 8usize,
1093 concat!("Alignment of ", stringify!(cudaMemcpy3DParms))
1094 );
1095 assert_eq!(
1096 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).srcArray as *const _ as usize },
1097 0usize,
1098 concat!(
1099 "Offset of field: ",
1100 stringify!(cudaMemcpy3DParms),
1101 "::",
1102 stringify!(srcArray)
1103 )
1104 );
1105 assert_eq!(
1106 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).srcPos as *const _ as usize },
1107 8usize,
1108 concat!(
1109 "Offset of field: ",
1110 stringify!(cudaMemcpy3DParms),
1111 "::",
1112 stringify!(srcPos)
1113 )
1114 );
1115 assert_eq!(
1116 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).srcPtr as *const _ as usize },
1117 32usize,
1118 concat!(
1119 "Offset of field: ",
1120 stringify!(cudaMemcpy3DParms),
1121 "::",
1122 stringify!(srcPtr)
1123 )
1124 );
1125 assert_eq!(
1126 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).dstArray as *const _ as usize },
1127 64usize,
1128 concat!(
1129 "Offset of field: ",
1130 stringify!(cudaMemcpy3DParms),
1131 "::",
1132 stringify!(dstArray)
1133 )
1134 );
1135 assert_eq!(
1136 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).dstPos as *const _ as usize },
1137 72usize,
1138 concat!(
1139 "Offset of field: ",
1140 stringify!(cudaMemcpy3DParms),
1141 "::",
1142 stringify!(dstPos)
1143 )
1144 );
1145 assert_eq!(
1146 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).dstPtr as *const _ as usize },
1147 96usize,
1148 concat!(
1149 "Offset of field: ",
1150 stringify!(cudaMemcpy3DParms),
1151 "::",
1152 stringify!(dstPtr)
1153 )
1154 );
1155 assert_eq!(
1156 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).extent as *const _ as usize },
1157 128usize,
1158 concat!(
1159 "Offset of field: ",
1160 stringify!(cudaMemcpy3DParms),
1161 "::",
1162 stringify!(extent)
1163 )
1164 );
1165 assert_eq!(
1166 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DParms>())).kind as *const _ as usize },
1167 152usize,
1168 concat!(
1169 "Offset of field: ",
1170 stringify!(cudaMemcpy3DParms),
1171 "::",
1172 stringify!(kind)
1173 )
1174 );
1175}
1176#[doc = " CUDA 3D cross-device memory copying parameters"]
1177#[repr(C)]
1178#[derive(Debug, Copy, Clone)]
1179pub struct cudaMemcpy3DPeerParms {
1180 #[doc = "< Source memory address"]
1181 pub srcArray: cudaArray_t,
1182 #[doc = "< Source position offset"]
1183 pub srcPos: cudaPos,
1184 #[doc = "< Pitched source memory address"]
1185 pub srcPtr: cudaPitchedPtr,
1186 #[doc = "< Source device"]
1187 pub srcDevice: ::libc::c_int,
1188 #[doc = "< Destination memory address"]
1189 pub dstArray: cudaArray_t,
1190 #[doc = "< Destination position offset"]
1191 pub dstPos: cudaPos,
1192 #[doc = "< Pitched destination memory address"]
1193 pub dstPtr: cudaPitchedPtr,
1194 #[doc = "< Destination device"]
1195 pub dstDevice: ::libc::c_int,
1196 #[doc = "< Requested memory copy size"]
1197 pub extent: cudaExtent,
1198}
1199#[test]
1200fn bindgen_test_layout_cudaMemcpy3DPeerParms() {
1201 assert_eq!(
1202 ::std::mem::size_of::<cudaMemcpy3DPeerParms>(),
1203 168usize,
1204 concat!("Size of: ", stringify!(cudaMemcpy3DPeerParms))
1205 );
1206 assert_eq!(
1207 ::std::mem::align_of::<cudaMemcpy3DPeerParms>(),
1208 8usize,
1209 concat!("Alignment of ", stringify!(cudaMemcpy3DPeerParms))
1210 );
1211 assert_eq!(
1212 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).srcArray as *const _ as usize },
1213 0usize,
1214 concat!(
1215 "Offset of field: ",
1216 stringify!(cudaMemcpy3DPeerParms),
1217 "::",
1218 stringify!(srcArray)
1219 )
1220 );
1221 assert_eq!(
1222 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).srcPos as *const _ as usize },
1223 8usize,
1224 concat!(
1225 "Offset of field: ",
1226 stringify!(cudaMemcpy3DPeerParms),
1227 "::",
1228 stringify!(srcPos)
1229 )
1230 );
1231 assert_eq!(
1232 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).srcPtr as *const _ as usize },
1233 32usize,
1234 concat!(
1235 "Offset of field: ",
1236 stringify!(cudaMemcpy3DPeerParms),
1237 "::",
1238 stringify!(srcPtr)
1239 )
1240 );
1241 assert_eq!(
1242 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).srcDevice as *const _ as usize },
1243 64usize,
1244 concat!(
1245 "Offset of field: ",
1246 stringify!(cudaMemcpy3DPeerParms),
1247 "::",
1248 stringify!(srcDevice)
1249 )
1250 );
1251 assert_eq!(
1252 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).dstArray as *const _ as usize },
1253 72usize,
1254 concat!(
1255 "Offset of field: ",
1256 stringify!(cudaMemcpy3DPeerParms),
1257 "::",
1258 stringify!(dstArray)
1259 )
1260 );
1261 assert_eq!(
1262 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).dstPos as *const _ as usize },
1263 80usize,
1264 concat!(
1265 "Offset of field: ",
1266 stringify!(cudaMemcpy3DPeerParms),
1267 "::",
1268 stringify!(dstPos)
1269 )
1270 );
1271 assert_eq!(
1272 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).dstPtr as *const _ as usize },
1273 104usize,
1274 concat!(
1275 "Offset of field: ",
1276 stringify!(cudaMemcpy3DPeerParms),
1277 "::",
1278 stringify!(dstPtr)
1279 )
1280 );
1281 assert_eq!(
1282 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).dstDevice as *const _ as usize },
1283 136usize,
1284 concat!(
1285 "Offset of field: ",
1286 stringify!(cudaMemcpy3DPeerParms),
1287 "::",
1288 stringify!(dstDevice)
1289 )
1290 );
1291 assert_eq!(
1292 unsafe { &(*(::std::ptr::null::<cudaMemcpy3DPeerParms>())).extent as *const _ as usize },
1293 144usize,
1294 concat!(
1295 "Offset of field: ",
1296 stringify!(cudaMemcpy3DPeerParms),
1297 "::",
1298 stringify!(extent)
1299 )
1300 );
1301}
1302#[doc = " CUDA Memset node parameters"]
1303#[repr(C)]
1304#[derive(Debug, Copy, Clone)]
1305pub struct cudaMemsetParams {
1306 #[doc = "< Destination device pointer"]
1307 pub dst: *mut ::libc::c_void,
1308 #[doc = "< Pitch of destination device pointer. Unused if height is 1"]
1309 pub pitch: usize,
1310 #[doc = "< Value to be set"]
1311 pub value: ::libc::c_uint,
1312 #[doc = "< Size of each element in bytes. Must be 1, 2, or 4."]
1313 pub elementSize: ::libc::c_uint,
1314 #[doc = "< Width of the row in elements"]
1315 pub width: usize,
1316 #[doc = "< Number of rows"]
1317 pub height: usize,
1318}
1319#[test]
1320fn bindgen_test_layout_cudaMemsetParams() {
1321 assert_eq!(
1322 ::std::mem::size_of::<cudaMemsetParams>(),
1323 40usize,
1324 concat!("Size of: ", stringify!(cudaMemsetParams))
1325 );
1326 assert_eq!(
1327 ::std::mem::align_of::<cudaMemsetParams>(),
1328 8usize,
1329 concat!("Alignment of ", stringify!(cudaMemsetParams))
1330 );
1331 assert_eq!(
1332 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).dst as *const _ as usize },
1333 0usize,
1334 concat!(
1335 "Offset of field: ",
1336 stringify!(cudaMemsetParams),
1337 "::",
1338 stringify!(dst)
1339 )
1340 );
1341 assert_eq!(
1342 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).pitch as *const _ as usize },
1343 8usize,
1344 concat!(
1345 "Offset of field: ",
1346 stringify!(cudaMemsetParams),
1347 "::",
1348 stringify!(pitch)
1349 )
1350 );
1351 assert_eq!(
1352 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).value as *const _ as usize },
1353 16usize,
1354 concat!(
1355 "Offset of field: ",
1356 stringify!(cudaMemsetParams),
1357 "::",
1358 stringify!(value)
1359 )
1360 );
1361 assert_eq!(
1362 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).elementSize as *const _ as usize },
1363 20usize,
1364 concat!(
1365 "Offset of field: ",
1366 stringify!(cudaMemsetParams),
1367 "::",
1368 stringify!(elementSize)
1369 )
1370 );
1371 assert_eq!(
1372 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).width as *const _ as usize },
1373 24usize,
1374 concat!(
1375 "Offset of field: ",
1376 stringify!(cudaMemsetParams),
1377 "::",
1378 stringify!(width)
1379 )
1380 );
1381 assert_eq!(
1382 unsafe { &(*(::std::ptr::null::<cudaMemsetParams>())).height as *const _ as usize },
1383 32usize,
1384 concat!(
1385 "Offset of field: ",
1386 stringify!(cudaMemsetParams),
1387 "::",
1388 stringify!(height)
1389 )
1390 );
1391}
1392#[repr(u32)]
1393#[non_exhaustive]
1394#[doc = " Specifies performance hint with ::cudaAccessPolicyWindow for hitProp and missProp members."]
1395#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1396pub enum cudaAccessProperty {
1397 #[doc = "< Normal cache persistence."]
1398 cudaAccessPropertyNormal = 0,
1399 #[doc = "< Streaming access is less likely to persit from cache."]
1400 cudaAccessPropertyStreaming = 1,
1401 #[doc = "< Persisting access is more likely to persist in cache."]
1402 cudaAccessPropertyPersisting = 2,
1403}
1404#[doc = " Specifies an access policy for a window, a contiguous extent of memory"]
1405#[doc = " beginning at base_ptr and ending at base_ptr + num_bytes."]
1406#[doc = " Partition into many segments and assign segments such that."]
1407#[doc = " sum of \"hit segments\" / window == approx. ratio."]
1408#[doc = " sum of \"miss segments\" / window == approx 1-ratio."]
1409#[doc = " Segments and ratio specifications are fitted to the capabilities of"]
1410#[doc = " the architecture."]
1411#[doc = " Accesses in a hit segment apply the hitProp access policy."]
1412#[doc = " Accesses in a miss segment apply the missProp access policy."]
1413#[repr(C)]
1414#[derive(Debug, Copy, Clone)]
1415pub struct cudaAccessPolicyWindow {
1416 #[doc = "< Starting address of the access policy window. CUDA driver may align it."]
1417 pub base_ptr: *mut ::libc::c_void,
1418 #[doc = "< Size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment."]
1419 pub num_bytes: usize,
1420 #[doc = "< hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp."]
1421 pub hitRatio: f32,
1422 #[doc = "< ::CUaccessProperty set for hit."]
1423 pub hitProp: cudaAccessProperty,
1424 #[doc = "< ::CUaccessProperty set for miss. Must be either NORMAL or STREAMING."]
1425 pub missProp: cudaAccessProperty,
1426}
1427#[test]
1428fn bindgen_test_layout_cudaAccessPolicyWindow() {
1429 assert_eq!(
1430 ::std::mem::size_of::<cudaAccessPolicyWindow>(),
1431 32usize,
1432 concat!("Size of: ", stringify!(cudaAccessPolicyWindow))
1433 );
1434 assert_eq!(
1435 ::std::mem::align_of::<cudaAccessPolicyWindow>(),
1436 8usize,
1437 concat!("Alignment of ", stringify!(cudaAccessPolicyWindow))
1438 );
1439 assert_eq!(
1440 unsafe { &(*(::std::ptr::null::<cudaAccessPolicyWindow>())).base_ptr as *const _ as usize },
1441 0usize,
1442 concat!(
1443 "Offset of field: ",
1444 stringify!(cudaAccessPolicyWindow),
1445 "::",
1446 stringify!(base_ptr)
1447 )
1448 );
1449 assert_eq!(
1450 unsafe {
1451 &(*(::std::ptr::null::<cudaAccessPolicyWindow>())).num_bytes as *const _ as usize
1452 },
1453 8usize,
1454 concat!(
1455 "Offset of field: ",
1456 stringify!(cudaAccessPolicyWindow),
1457 "::",
1458 stringify!(num_bytes)
1459 )
1460 );
1461 assert_eq!(
1462 unsafe { &(*(::std::ptr::null::<cudaAccessPolicyWindow>())).hitRatio as *const _ as usize },
1463 16usize,
1464 concat!(
1465 "Offset of field: ",
1466 stringify!(cudaAccessPolicyWindow),
1467 "::",
1468 stringify!(hitRatio)
1469 )
1470 );
1471 assert_eq!(
1472 unsafe { &(*(::std::ptr::null::<cudaAccessPolicyWindow>())).hitProp as *const _ as usize },
1473 20usize,
1474 concat!(
1475 "Offset of field: ",
1476 stringify!(cudaAccessPolicyWindow),
1477 "::",
1478 stringify!(hitProp)
1479 )
1480 );
1481 assert_eq!(
1482 unsafe { &(*(::std::ptr::null::<cudaAccessPolicyWindow>())).missProp as *const _ as usize },
1483 24usize,
1484 concat!(
1485 "Offset of field: ",
1486 stringify!(cudaAccessPolicyWindow),
1487 "::",
1488 stringify!(missProp)
1489 )
1490 );
1491}
1492#[doc = " CUDA host function"]
1493#[doc = " \\param userData Argument value passed to the function"]
1494pub type cudaHostFn_t = ::std::option::Option<unsafe extern "C" fn(userData: *mut ::libc::c_void)>;
1495#[doc = " CUDA host node parameters"]
1496#[repr(C)]
1497#[derive(Debug, Copy, Clone)]
1498pub struct cudaHostNodeParams {
1499 #[doc = "< The function to call when the node executes"]
1500 pub fn_: cudaHostFn_t,
1501 #[doc = "< Argument to pass to the function"]
1502 pub userData: *mut ::libc::c_void,
1503}
1504#[test]
1505fn bindgen_test_layout_cudaHostNodeParams() {
1506 assert_eq!(
1507 ::std::mem::size_of::<cudaHostNodeParams>(),
1508 16usize,
1509 concat!("Size of: ", stringify!(cudaHostNodeParams))
1510 );
1511 assert_eq!(
1512 ::std::mem::align_of::<cudaHostNodeParams>(),
1513 8usize,
1514 concat!("Alignment of ", stringify!(cudaHostNodeParams))
1515 );
1516 assert_eq!(
1517 unsafe { &(*(::std::ptr::null::<cudaHostNodeParams>())).fn_ as *const _ as usize },
1518 0usize,
1519 concat!(
1520 "Offset of field: ",
1521 stringify!(cudaHostNodeParams),
1522 "::",
1523 stringify!(fn_)
1524 )
1525 );
1526 assert_eq!(
1527 unsafe { &(*(::std::ptr::null::<cudaHostNodeParams>())).userData as *const _ as usize },
1528 8usize,
1529 concat!(
1530 "Offset of field: ",
1531 stringify!(cudaHostNodeParams),
1532 "::",
1533 stringify!(userData)
1534 )
1535 );
1536}
1537#[repr(u32)]
1538#[non_exhaustive]
1539#[doc = " Possible stream capture statuses returned by ::cudaStreamIsCapturing"]
1540#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1541pub enum cudaStreamCaptureStatus {
1542 #[doc = "< Stream is not capturing"]
1543 cudaStreamCaptureStatusNone = 0,
1544 #[doc = "< Stream is actively capturing"]
1545 cudaStreamCaptureStatusActive = 1,
1546 #[doc = "< Stream is part of a capture sequence that"]
1547 #[doc = "has been invalidated, but not terminated"]
1548 cudaStreamCaptureStatusInvalidated = 2,
1549}
1550#[repr(u32)]
1551#[non_exhaustive]
1552#[doc = " Possible modes for stream capture thread interactions. For more details see"]
1553#[doc = " ::cudaStreamBeginCapture and ::cudaThreadExchangeStreamCaptureMode"]
1554#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1555pub enum cudaStreamCaptureMode {
1556 cudaStreamCaptureModeGlobal = 0,
1557 cudaStreamCaptureModeThreadLocal = 1,
1558 cudaStreamCaptureModeRelaxed = 2,
1559}
1560#[repr(u32)]
1561#[non_exhaustive]
1562#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1563pub enum cudaSynchronizationPolicy {
1564 cudaSyncPolicyAuto = 1,
1565 cudaSyncPolicySpin = 2,
1566 cudaSyncPolicyYield = 3,
1567 cudaSyncPolicyBlockingSync = 4,
1568}
1569#[repr(u32)]
1570#[non_exhaustive]
1571#[doc = " Stream Attributes"]
1572#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1573pub enum cudaStreamAttrID {
1574 #[doc = "< Identifier for ::cudaStreamAttrValue::accessPolicyWindow."]
1575 cudaStreamAttributeAccessPolicyWindow = 1,
1576 #[doc = "< ::cudaSynchronizationPolicy for work queued up in this stream"]
1577 cudaStreamAttributeSynchronizationPolicy = 3,
1578}
1579#[doc = " Stream attributes union used with ::cudaStreamSetAttribute/::cudaStreamGetAttribute"]
1580#[repr(C)]
1581#[derive(Copy, Clone)]
1582pub union cudaStreamAttrValue {
1583 pub accessPolicyWindow: cudaAccessPolicyWindow,
1584 pub syncPolicy: cudaSynchronizationPolicy,
1585}
1586#[test]
1587fn bindgen_test_layout_cudaStreamAttrValue() {
1588 assert_eq!(
1589 ::std::mem::size_of::<cudaStreamAttrValue>(),
1590 32usize,
1591 concat!("Size of: ", stringify!(cudaStreamAttrValue))
1592 );
1593 assert_eq!(
1594 ::std::mem::align_of::<cudaStreamAttrValue>(),
1595 8usize,
1596 concat!("Alignment of ", stringify!(cudaStreamAttrValue))
1597 );
1598 assert_eq!(
1599 unsafe {
1600 &(*(::std::ptr::null::<cudaStreamAttrValue>())).accessPolicyWindow as *const _ as usize
1601 },
1602 0usize,
1603 concat!(
1604 "Offset of field: ",
1605 stringify!(cudaStreamAttrValue),
1606 "::",
1607 stringify!(accessPolicyWindow)
1608 )
1609 );
1610 assert_eq!(
1611 unsafe { &(*(::std::ptr::null::<cudaStreamAttrValue>())).syncPolicy as *const _ as usize },
1612 0usize,
1613 concat!(
1614 "Offset of field: ",
1615 stringify!(cudaStreamAttrValue),
1616 "::",
1617 stringify!(syncPolicy)
1618 )
1619 );
1620}
1621#[repr(u32)]
1622#[non_exhaustive]
1623#[doc = " Flags for ::cudaStreamUpdateCaptureDependencies"]
1624#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1625pub enum cudaStreamUpdateCaptureDependenciesFlags {
1626 #[doc = "< Add new nodes to the dependency set"]
1627 cudaStreamAddCaptureDependencies = 0,
1628 #[doc = "< Replace the dependency set with the new nodes"]
1629 cudaStreamSetCaptureDependencies = 1,
1630}
1631#[repr(u32)]
1632#[non_exhaustive]
1633#[doc = " Flags for user objects for graphs"]
1634#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1635pub enum cudaUserObjectFlags {
1636 #[doc = "< Indicates the destructor execution is not synchronized by any CUDA handle."]
1637 cudaUserObjectNoDestructorSync = 1,
1638}
1639#[repr(u32)]
1640#[non_exhaustive]
1641#[doc = " Flags for retaining user object references for graphs"]
1642#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1643pub enum cudaUserObjectRetainFlags {
1644 #[doc = "< Transfer references from the caller rather than creating new references."]
1645 cudaGraphUserObjectMove = 1,
1646}
1647#[doc = " CUDA graphics interop resource"]
1648#[repr(C)]
1649#[derive(Debug, Copy, Clone)]
1650pub struct cudaGraphicsResource {
1651 _unused: [u8; 0],
1652}
1653#[repr(u32)]
1654#[non_exhaustive]
1655#[doc = " CUDA graphics interop register flags"]
1656#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1657pub enum cudaGraphicsRegisterFlags {
1658 #[doc = "< Default"]
1659 cudaGraphicsRegisterFlagsNone = 0,
1660 #[doc = "< CUDA will not write to this resource"]
1661 cudaGraphicsRegisterFlagsReadOnly = 1,
1662 #[doc = "< CUDA will only write to and will not read from this resource"]
1663 cudaGraphicsRegisterFlagsWriteDiscard = 2,
1664 #[doc = "< CUDA will bind this resource to a surface reference"]
1665 cudaGraphicsRegisterFlagsSurfaceLoadStore = 4,
1666 #[doc = "< CUDA will perform texture gather operations on this resource"]
1667 cudaGraphicsRegisterFlagsTextureGather = 8,
1668}
1669#[repr(u32)]
1670#[non_exhaustive]
1671#[doc = " CUDA graphics interop map flags"]
1672#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1673pub enum cudaGraphicsMapFlags {
1674 #[doc = "< Default; Assume resource can be read/written"]
1675 cudaGraphicsMapFlagsNone = 0,
1676 #[doc = "< CUDA will not write to this resource"]
1677 cudaGraphicsMapFlagsReadOnly = 1,
1678 #[doc = "< CUDA will only write to and will not read from this resource"]
1679 cudaGraphicsMapFlagsWriteDiscard = 2,
1680}
1681#[repr(u32)]
1682#[non_exhaustive]
1683#[doc = " CUDA graphics interop array indices for cube maps"]
1684#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1685pub enum cudaGraphicsCubeFace {
1686 #[doc = "< Positive X face of cubemap"]
1687 cudaGraphicsCubeFacePositiveX = 0,
1688 #[doc = "< Negative X face of cubemap"]
1689 cudaGraphicsCubeFaceNegativeX = 1,
1690 #[doc = "< Positive Y face of cubemap"]
1691 cudaGraphicsCubeFacePositiveY = 2,
1692 #[doc = "< Negative Y face of cubemap"]
1693 cudaGraphicsCubeFaceNegativeY = 3,
1694 #[doc = "< Positive Z face of cubemap"]
1695 cudaGraphicsCubeFacePositiveZ = 4,
1696 #[doc = "< Negative Z face of cubemap"]
1697 cudaGraphicsCubeFaceNegativeZ = 5,
1698}
1699#[repr(u32)]
1700#[non_exhaustive]
1701#[doc = " Graph kernel node Attributes"]
1702#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1703pub enum cudaKernelNodeAttrID {
1704 #[doc = "< Identifier for ::cudaKernelNodeAttrValue::accessPolicyWindow."]
1705 cudaKernelNodeAttributeAccessPolicyWindow = 1,
1706 #[doc = "< Allows a kernel node to be cooperative (see ::cudaLaunchCooperativeKernel)."]
1707 cudaKernelNodeAttributeCooperative = 2,
1708}
1709#[doc = " Graph kernel node attributes union, used with ::cudaGraphKernelNodeSetAttribute/::cudaGraphKernelNodeGetAttribute"]
1710#[repr(C)]
1711#[derive(Copy, Clone)]
1712pub union cudaKernelNodeAttrValue {
1713 #[doc = "< Attribute ::CUaccessPolicyWindow."]
1714 pub accessPolicyWindow: cudaAccessPolicyWindow,
1715 pub cooperative: ::libc::c_int,
1716}
1717#[test]
1718fn bindgen_test_layout_cudaKernelNodeAttrValue() {
1719 assert_eq!(
1720 ::std::mem::size_of::<cudaKernelNodeAttrValue>(),
1721 32usize,
1722 concat!("Size of: ", stringify!(cudaKernelNodeAttrValue))
1723 );
1724 assert_eq!(
1725 ::std::mem::align_of::<cudaKernelNodeAttrValue>(),
1726 8usize,
1727 concat!("Alignment of ", stringify!(cudaKernelNodeAttrValue))
1728 );
1729 assert_eq!(
1730 unsafe {
1731 &(*(::std::ptr::null::<cudaKernelNodeAttrValue>())).accessPolicyWindow as *const _
1732 as usize
1733 },
1734 0usize,
1735 concat!(
1736 "Offset of field: ",
1737 stringify!(cudaKernelNodeAttrValue),
1738 "::",
1739 stringify!(accessPolicyWindow)
1740 )
1741 );
1742 assert_eq!(
1743 unsafe {
1744 &(*(::std::ptr::null::<cudaKernelNodeAttrValue>())).cooperative as *const _ as usize
1745 },
1746 0usize,
1747 concat!(
1748 "Offset of field: ",
1749 stringify!(cudaKernelNodeAttrValue),
1750 "::",
1751 stringify!(cooperative)
1752 )
1753 );
1754}
1755#[repr(u32)]
1756#[non_exhaustive]
1757#[doc = " CUDA resource types"]
1758#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1759pub enum cudaResourceType {
1760 #[doc = "< Array resource"]
1761 cudaResourceTypeArray = 0,
1762 #[doc = "< Mipmapped array resource"]
1763 cudaResourceTypeMipmappedArray = 1,
1764 #[doc = "< Linear resource"]
1765 cudaResourceTypeLinear = 2,
1766 #[doc = "< Pitch 2D resource"]
1767 cudaResourceTypePitch2D = 3,
1768}
1769#[repr(u32)]
1770#[non_exhaustive]
1771#[doc = " CUDA texture resource view formats"]
1772#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1773pub enum cudaResourceViewFormat {
1774 #[doc = "< No resource view format (use underlying resource format)"]
1775 cudaResViewFormatNone = 0,
1776 #[doc = "< 1 channel unsigned 8-bit integers"]
1777 cudaResViewFormatUnsignedChar1 = 1,
1778 #[doc = "< 2 channel unsigned 8-bit integers"]
1779 cudaResViewFormatUnsignedChar2 = 2,
1780 #[doc = "< 4 channel unsigned 8-bit integers"]
1781 cudaResViewFormatUnsignedChar4 = 3,
1782 #[doc = "< 1 channel signed 8-bit integers"]
1783 cudaResViewFormatSignedChar1 = 4,
1784 #[doc = "< 2 channel signed 8-bit integers"]
1785 cudaResViewFormatSignedChar2 = 5,
1786 #[doc = "< 4 channel signed 8-bit integers"]
1787 cudaResViewFormatSignedChar4 = 6,
1788 #[doc = "< 1 channel unsigned 16-bit integers"]
1789 cudaResViewFormatUnsignedShort1 = 7,
1790 #[doc = "< 2 channel unsigned 16-bit integers"]
1791 cudaResViewFormatUnsignedShort2 = 8,
1792 #[doc = "< 4 channel unsigned 16-bit integers"]
1793 cudaResViewFormatUnsignedShort4 = 9,
1794 #[doc = "< 1 channel signed 16-bit integers"]
1795 cudaResViewFormatSignedShort1 = 10,
1796 #[doc = "< 2 channel signed 16-bit integers"]
1797 cudaResViewFormatSignedShort2 = 11,
1798 #[doc = "< 4 channel signed 16-bit integers"]
1799 cudaResViewFormatSignedShort4 = 12,
1800 #[doc = "< 1 channel unsigned 32-bit integers"]
1801 cudaResViewFormatUnsignedInt1 = 13,
1802 #[doc = "< 2 channel unsigned 32-bit integers"]
1803 cudaResViewFormatUnsignedInt2 = 14,
1804 #[doc = "< 4 channel unsigned 32-bit integers"]
1805 cudaResViewFormatUnsignedInt4 = 15,
1806 #[doc = "< 1 channel signed 32-bit integers"]
1807 cudaResViewFormatSignedInt1 = 16,
1808 #[doc = "< 2 channel signed 32-bit integers"]
1809 cudaResViewFormatSignedInt2 = 17,
1810 #[doc = "< 4 channel signed 32-bit integers"]
1811 cudaResViewFormatSignedInt4 = 18,
1812 #[doc = "< 1 channel 16-bit floating point"]
1813 cudaResViewFormatHalf1 = 19,
1814 #[doc = "< 2 channel 16-bit floating point"]
1815 cudaResViewFormatHalf2 = 20,
1816 #[doc = "< 4 channel 16-bit floating point"]
1817 cudaResViewFormatHalf4 = 21,
1818 #[doc = "< 1 channel 32-bit floating point"]
1819 cudaResViewFormatFloat1 = 22,
1820 #[doc = "< 2 channel 32-bit floating point"]
1821 cudaResViewFormatFloat2 = 23,
1822 #[doc = "< 4 channel 32-bit floating point"]
1823 cudaResViewFormatFloat4 = 24,
1824 #[doc = "< Block compressed 1"]
1825 cudaResViewFormatUnsignedBlockCompressed1 = 25,
1826 #[doc = "< Block compressed 2"]
1827 cudaResViewFormatUnsignedBlockCompressed2 = 26,
1828 #[doc = "< Block compressed 3"]
1829 cudaResViewFormatUnsignedBlockCompressed3 = 27,
1830 #[doc = "< Block compressed 4 unsigned"]
1831 cudaResViewFormatUnsignedBlockCompressed4 = 28,
1832 #[doc = "< Block compressed 4 signed"]
1833 cudaResViewFormatSignedBlockCompressed4 = 29,
1834 #[doc = "< Block compressed 5 unsigned"]
1835 cudaResViewFormatUnsignedBlockCompressed5 = 30,
1836 #[doc = "< Block compressed 5 signed"]
1837 cudaResViewFormatSignedBlockCompressed5 = 31,
1838 #[doc = "< Block compressed 6 unsigned half-float"]
1839 cudaResViewFormatUnsignedBlockCompressed6H = 32,
1840 #[doc = "< Block compressed 6 signed half-float"]
1841 cudaResViewFormatSignedBlockCompressed6H = 33,
1842 #[doc = "< Block compressed 7"]
1843 cudaResViewFormatUnsignedBlockCompressed7 = 34,
1844}
1845#[doc = " CUDA resource descriptor"]
1846#[repr(C)]
1847#[derive(Copy, Clone)]
1848pub struct cudaResourceDesc {
1849 #[doc = "< Resource type"]
1850 pub resType: cudaResourceType,
1851 pub res: cudaResourceDesc__bindgen_ty_1,
1852}
1853#[repr(C)]
1854#[derive(Copy, Clone)]
1855pub union cudaResourceDesc__bindgen_ty_1 {
1856 pub array: cudaResourceDesc__bindgen_ty_1__bindgen_ty_1,
1857 pub mipmap: cudaResourceDesc__bindgen_ty_1__bindgen_ty_2,
1858 pub linear: cudaResourceDesc__bindgen_ty_1__bindgen_ty_3,
1859 pub pitch2D: cudaResourceDesc__bindgen_ty_1__bindgen_ty_4,
1860}
1861#[repr(C)]
1862#[derive(Debug, Copy, Clone)]
1863pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_1 {
1864 #[doc = "< CUDA array"]
1865 pub array: cudaArray_t,
1866}
1867#[test]
1868fn bindgen_test_layout_cudaResourceDesc__bindgen_ty_1__bindgen_ty_1() {
1869 assert_eq!(
1870 ::std::mem::size_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_1>(),
1871 8usize,
1872 concat!(
1873 "Size of: ",
1874 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_1)
1875 )
1876 );
1877 assert_eq!(
1878 ::std::mem::align_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_1>(),
1879 8usize,
1880 concat!(
1881 "Alignment of ",
1882 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_1)
1883 )
1884 );
1885 assert_eq!(
1886 unsafe {
1887 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_1>())).array
1888 as *const _ as usize
1889 },
1890 0usize,
1891 concat!(
1892 "Offset of field: ",
1893 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_1),
1894 "::",
1895 stringify!(array)
1896 )
1897 );
1898}
1899#[repr(C)]
1900#[derive(Debug, Copy, Clone)]
1901pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_2 {
1902 #[doc = "< CUDA mipmapped array"]
1903 pub mipmap: cudaMipmappedArray_t,
1904}
1905#[test]
1906fn bindgen_test_layout_cudaResourceDesc__bindgen_ty_1__bindgen_ty_2() {
1907 assert_eq!(
1908 ::std::mem::size_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_2>(),
1909 8usize,
1910 concat!(
1911 "Size of: ",
1912 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_2)
1913 )
1914 );
1915 assert_eq!(
1916 ::std::mem::align_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_2>(),
1917 8usize,
1918 concat!(
1919 "Alignment of ",
1920 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_2)
1921 )
1922 );
1923 assert_eq!(
1924 unsafe {
1925 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_2>())).mipmap
1926 as *const _ as usize
1927 },
1928 0usize,
1929 concat!(
1930 "Offset of field: ",
1931 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_2),
1932 "::",
1933 stringify!(mipmap)
1934 )
1935 );
1936}
1937#[repr(C)]
1938#[derive(Debug, Copy, Clone)]
1939pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_3 {
1940 #[doc = "< Device pointer"]
1941 pub devPtr: *mut ::libc::c_void,
1942 #[doc = "< Channel descriptor"]
1943 pub desc: cudaChannelFormatDesc,
1944 #[doc = "< Size in bytes"]
1945 pub sizeInBytes: usize,
1946}
1947#[test]
1948fn bindgen_test_layout_cudaResourceDesc__bindgen_ty_1__bindgen_ty_3() {
1949 assert_eq!(
1950 ::std::mem::size_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_3>(),
1951 40usize,
1952 concat!(
1953 "Size of: ",
1954 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_3)
1955 )
1956 );
1957 assert_eq!(
1958 ::std::mem::align_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_3>(),
1959 8usize,
1960 concat!(
1961 "Alignment of ",
1962 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_3)
1963 )
1964 );
1965 assert_eq!(
1966 unsafe {
1967 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_3>())).devPtr
1968 as *const _ as usize
1969 },
1970 0usize,
1971 concat!(
1972 "Offset of field: ",
1973 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_3),
1974 "::",
1975 stringify!(devPtr)
1976 )
1977 );
1978 assert_eq!(
1979 unsafe {
1980 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_3>())).desc
1981 as *const _ as usize
1982 },
1983 8usize,
1984 concat!(
1985 "Offset of field: ",
1986 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_3),
1987 "::",
1988 stringify!(desc)
1989 )
1990 );
1991 assert_eq!(
1992 unsafe {
1993 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_3>())).sizeInBytes
1994 as *const _ as usize
1995 },
1996 32usize,
1997 concat!(
1998 "Offset of field: ",
1999 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_3),
2000 "::",
2001 stringify!(sizeInBytes)
2002 )
2003 );
2004}
2005#[repr(C)]
2006#[derive(Debug, Copy, Clone)]
2007pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_4 {
2008 #[doc = "< Device pointer"]
2009 pub devPtr: *mut ::libc::c_void,
2010 #[doc = "< Channel descriptor"]
2011 pub desc: cudaChannelFormatDesc,
2012 #[doc = "< Width of the array in elements"]
2013 pub width: usize,
2014 #[doc = "< Height of the array in elements"]
2015 pub height: usize,
2016 #[doc = "< Pitch between two rows in bytes"]
2017 pub pitchInBytes: usize,
2018}
2019#[test]
2020fn bindgen_test_layout_cudaResourceDesc__bindgen_ty_1__bindgen_ty_4() {
2021 assert_eq!(
2022 ::std::mem::size_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>(),
2023 56usize,
2024 concat!(
2025 "Size of: ",
2026 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4)
2027 )
2028 );
2029 assert_eq!(
2030 ::std::mem::align_of::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>(),
2031 8usize,
2032 concat!(
2033 "Alignment of ",
2034 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4)
2035 )
2036 );
2037 assert_eq!(
2038 unsafe {
2039 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>())).devPtr
2040 as *const _ as usize
2041 },
2042 0usize,
2043 concat!(
2044 "Offset of field: ",
2045 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4),
2046 "::",
2047 stringify!(devPtr)
2048 )
2049 );
2050 assert_eq!(
2051 unsafe {
2052 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>())).desc
2053 as *const _ as usize
2054 },
2055 8usize,
2056 concat!(
2057 "Offset of field: ",
2058 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4),
2059 "::",
2060 stringify!(desc)
2061 )
2062 );
2063 assert_eq!(
2064 unsafe {
2065 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>())).width
2066 as *const _ as usize
2067 },
2068 32usize,
2069 concat!(
2070 "Offset of field: ",
2071 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4),
2072 "::",
2073 stringify!(width)
2074 )
2075 );
2076 assert_eq!(
2077 unsafe {
2078 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>())).height
2079 as *const _ as usize
2080 },
2081 40usize,
2082 concat!(
2083 "Offset of field: ",
2084 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4),
2085 "::",
2086 stringify!(height)
2087 )
2088 );
2089 assert_eq!(
2090 unsafe {
2091 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1__bindgen_ty_4>())).pitchInBytes
2092 as *const _ as usize
2093 },
2094 48usize,
2095 concat!(
2096 "Offset of field: ",
2097 stringify!(cudaResourceDesc__bindgen_ty_1__bindgen_ty_4),
2098 "::",
2099 stringify!(pitchInBytes)
2100 )
2101 );
2102}
2103#[test]
2104fn bindgen_test_layout_cudaResourceDesc__bindgen_ty_1() {
2105 assert_eq!(
2106 ::std::mem::size_of::<cudaResourceDesc__bindgen_ty_1>(),
2107 56usize,
2108 concat!("Size of: ", stringify!(cudaResourceDesc__bindgen_ty_1))
2109 );
2110 assert_eq!(
2111 ::std::mem::align_of::<cudaResourceDesc__bindgen_ty_1>(),
2112 8usize,
2113 concat!("Alignment of ", stringify!(cudaResourceDesc__bindgen_ty_1))
2114 );
2115 assert_eq!(
2116 unsafe {
2117 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1>())).array as *const _ as usize
2118 },
2119 0usize,
2120 concat!(
2121 "Offset of field: ",
2122 stringify!(cudaResourceDesc__bindgen_ty_1),
2123 "::",
2124 stringify!(array)
2125 )
2126 );
2127 assert_eq!(
2128 unsafe {
2129 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1>())).mipmap as *const _ as usize
2130 },
2131 0usize,
2132 concat!(
2133 "Offset of field: ",
2134 stringify!(cudaResourceDesc__bindgen_ty_1),
2135 "::",
2136 stringify!(mipmap)
2137 )
2138 );
2139 assert_eq!(
2140 unsafe {
2141 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1>())).linear as *const _ as usize
2142 },
2143 0usize,
2144 concat!(
2145 "Offset of field: ",
2146 stringify!(cudaResourceDesc__bindgen_ty_1),
2147 "::",
2148 stringify!(linear)
2149 )
2150 );
2151 assert_eq!(
2152 unsafe {
2153 &(*(::std::ptr::null::<cudaResourceDesc__bindgen_ty_1>())).pitch2D as *const _ as usize
2154 },
2155 0usize,
2156 concat!(
2157 "Offset of field: ",
2158 stringify!(cudaResourceDesc__bindgen_ty_1),
2159 "::",
2160 stringify!(pitch2D)
2161 )
2162 );
2163}
2164#[test]
2165fn bindgen_test_layout_cudaResourceDesc() {
2166 assert_eq!(
2167 ::std::mem::size_of::<cudaResourceDesc>(),
2168 64usize,
2169 concat!("Size of: ", stringify!(cudaResourceDesc))
2170 );
2171 assert_eq!(
2172 ::std::mem::align_of::<cudaResourceDesc>(),
2173 8usize,
2174 concat!("Alignment of ", stringify!(cudaResourceDesc))
2175 );
2176 assert_eq!(
2177 unsafe { &(*(::std::ptr::null::<cudaResourceDesc>())).resType as *const _ as usize },
2178 0usize,
2179 concat!(
2180 "Offset of field: ",
2181 stringify!(cudaResourceDesc),
2182 "::",
2183 stringify!(resType)
2184 )
2185 );
2186 assert_eq!(
2187 unsafe { &(*(::std::ptr::null::<cudaResourceDesc>())).res as *const _ as usize },
2188 8usize,
2189 concat!(
2190 "Offset of field: ",
2191 stringify!(cudaResourceDesc),
2192 "::",
2193 stringify!(res)
2194 )
2195 );
2196}
2197#[doc = " CUDA resource view descriptor"]
2198#[repr(C)]
2199#[derive(Debug, Copy, Clone)]
2200pub struct cudaResourceViewDesc {
2201 #[doc = "< Resource view format"]
2202 pub format: cudaResourceViewFormat,
2203 #[doc = "< Width of the resource view"]
2204 pub width: usize,
2205 #[doc = "< Height of the resource view"]
2206 pub height: usize,
2207 #[doc = "< Depth of the resource view"]
2208 pub depth: usize,
2209 #[doc = "< First defined mipmap level"]
2210 pub firstMipmapLevel: ::libc::c_uint,
2211 #[doc = "< Last defined mipmap level"]
2212 pub lastMipmapLevel: ::libc::c_uint,
2213 #[doc = "< First layer index"]
2214 pub firstLayer: ::libc::c_uint,
2215 #[doc = "< Last layer index"]
2216 pub lastLayer: ::libc::c_uint,
2217}
2218#[test]
2219fn bindgen_test_layout_cudaResourceViewDesc() {
2220 assert_eq!(
2221 ::std::mem::size_of::<cudaResourceViewDesc>(),
2222 48usize,
2223 concat!("Size of: ", stringify!(cudaResourceViewDesc))
2224 );
2225 assert_eq!(
2226 ::std::mem::align_of::<cudaResourceViewDesc>(),
2227 8usize,
2228 concat!("Alignment of ", stringify!(cudaResourceViewDesc))
2229 );
2230 assert_eq!(
2231 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).format as *const _ as usize },
2232 0usize,
2233 concat!(
2234 "Offset of field: ",
2235 stringify!(cudaResourceViewDesc),
2236 "::",
2237 stringify!(format)
2238 )
2239 );
2240 assert_eq!(
2241 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).width as *const _ as usize },
2242 8usize,
2243 concat!(
2244 "Offset of field: ",
2245 stringify!(cudaResourceViewDesc),
2246 "::",
2247 stringify!(width)
2248 )
2249 );
2250 assert_eq!(
2251 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).height as *const _ as usize },
2252 16usize,
2253 concat!(
2254 "Offset of field: ",
2255 stringify!(cudaResourceViewDesc),
2256 "::",
2257 stringify!(height)
2258 )
2259 );
2260 assert_eq!(
2261 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).depth as *const _ as usize },
2262 24usize,
2263 concat!(
2264 "Offset of field: ",
2265 stringify!(cudaResourceViewDesc),
2266 "::",
2267 stringify!(depth)
2268 )
2269 );
2270 assert_eq!(
2271 unsafe {
2272 &(*(::std::ptr::null::<cudaResourceViewDesc>())).firstMipmapLevel as *const _ as usize
2273 },
2274 32usize,
2275 concat!(
2276 "Offset of field: ",
2277 stringify!(cudaResourceViewDesc),
2278 "::",
2279 stringify!(firstMipmapLevel)
2280 )
2281 );
2282 assert_eq!(
2283 unsafe {
2284 &(*(::std::ptr::null::<cudaResourceViewDesc>())).lastMipmapLevel as *const _ as usize
2285 },
2286 36usize,
2287 concat!(
2288 "Offset of field: ",
2289 stringify!(cudaResourceViewDesc),
2290 "::",
2291 stringify!(lastMipmapLevel)
2292 )
2293 );
2294 assert_eq!(
2295 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).firstLayer as *const _ as usize },
2296 40usize,
2297 concat!(
2298 "Offset of field: ",
2299 stringify!(cudaResourceViewDesc),
2300 "::",
2301 stringify!(firstLayer)
2302 )
2303 );
2304 assert_eq!(
2305 unsafe { &(*(::std::ptr::null::<cudaResourceViewDesc>())).lastLayer as *const _ as usize },
2306 44usize,
2307 concat!(
2308 "Offset of field: ",
2309 stringify!(cudaResourceViewDesc),
2310 "::",
2311 stringify!(lastLayer)
2312 )
2313 );
2314}
2315#[doc = " CUDA pointer attributes"]
2316#[repr(C)]
2317#[derive(Debug, Copy, Clone)]
2318pub struct cudaPointerAttributes {
2319 #[doc = " The type of memory - ::cudaMemoryTypeUnregistered, ::cudaMemoryTypeHost,"]
2320 #[doc = " ::cudaMemoryTypeDevice or ::cudaMemoryTypeManaged."]
2321 pub type_: cudaMemoryType,
2322 #[doc = " The device against which the memory was allocated or registered."]
2323 #[doc = " If the memory type is ::cudaMemoryTypeDevice then this identifies"]
2324 #[doc = " the device on which the memory referred physically resides. If"]
2325 #[doc = " the memory type is ::cudaMemoryTypeHost or::cudaMemoryTypeManaged then"]
2326 #[doc = " this identifies the device which was current when the memory was allocated"]
2327 #[doc = " or registered (and if that device is deinitialized then this allocation"]
2328 #[doc = " will vanish with that device's state)."]
2329 pub device: ::libc::c_int,
2330 #[doc = " The address which may be dereferenced on the current device to access"]
2331 #[doc = " the memory or NULL if no such address exists."]
2332 pub devicePointer: *mut ::libc::c_void,
2333 #[doc = " The address which may be dereferenced on the host to access the"]
2334 #[doc = " memory or NULL if no such address exists."]
2335 #[doc = ""]
2336 #[doc = " \\note CUDA doesn't check if unregistered memory is allocated so this field"]
2337 #[doc = " may contain invalid pointer if an invalid pointer has been passed to CUDA."]
2338 pub hostPointer: *mut ::libc::c_void,
2339}
2340#[test]
2341fn bindgen_test_layout_cudaPointerAttributes() {
2342 assert_eq!(
2343 ::std::mem::size_of::<cudaPointerAttributes>(),
2344 24usize,
2345 concat!("Size of: ", stringify!(cudaPointerAttributes))
2346 );
2347 assert_eq!(
2348 ::std::mem::align_of::<cudaPointerAttributes>(),
2349 8usize,
2350 concat!("Alignment of ", stringify!(cudaPointerAttributes))
2351 );
2352 assert_eq!(
2353 unsafe { &(*(::std::ptr::null::<cudaPointerAttributes>())).type_ as *const _ as usize },
2354 0usize,
2355 concat!(
2356 "Offset of field: ",
2357 stringify!(cudaPointerAttributes),
2358 "::",
2359 stringify!(type_)
2360 )
2361 );
2362 assert_eq!(
2363 unsafe { &(*(::std::ptr::null::<cudaPointerAttributes>())).device as *const _ as usize },
2364 4usize,
2365 concat!(
2366 "Offset of field: ",
2367 stringify!(cudaPointerAttributes),
2368 "::",
2369 stringify!(device)
2370 )
2371 );
2372 assert_eq!(
2373 unsafe {
2374 &(*(::std::ptr::null::<cudaPointerAttributes>())).devicePointer as *const _ as usize
2375 },
2376 8usize,
2377 concat!(
2378 "Offset of field: ",
2379 stringify!(cudaPointerAttributes),
2380 "::",
2381 stringify!(devicePointer)
2382 )
2383 );
2384 assert_eq!(
2385 unsafe {
2386 &(*(::std::ptr::null::<cudaPointerAttributes>())).hostPointer as *const _ as usize
2387 },
2388 16usize,
2389 concat!(
2390 "Offset of field: ",
2391 stringify!(cudaPointerAttributes),
2392 "::",
2393 stringify!(hostPointer)
2394 )
2395 );
2396}
2397#[doc = " CUDA function attributes"]
2398#[repr(C)]
2399#[derive(Debug, Copy, Clone)]
2400pub struct cudaFuncAttributes {
2401 #[doc = " The size in bytes of statically-allocated shared memory per block"]
2402 #[doc = " required by this function. This does not include dynamically-allocated"]
2403 #[doc = " shared memory requested by the user at runtime."]
2404 pub sharedSizeBytes: usize,
2405 #[doc = " The size in bytes of user-allocated constant memory required by this"]
2406 #[doc = " function."]
2407 pub constSizeBytes: usize,
2408 #[doc = " The size in bytes of local memory used by each thread of this function."]
2409 pub localSizeBytes: usize,
2410 #[doc = " The maximum number of threads per block, beyond which a launch of the"]
2411 #[doc = " function would fail. This number depends on both the function and the"]
2412 #[doc = " device on which the function is currently loaded."]
2413 pub maxThreadsPerBlock: ::libc::c_int,
2414 #[doc = " The number of registers used by each thread of this function."]
2415 pub numRegs: ::libc::c_int,
2416 #[doc = " The PTX virtual architecture version for which the function was"]
2417 #[doc = " compiled. This value is the major PTX version * 10 + the minor PTX"]
2418 #[doc = " version, so a PTX version 1.3 function would return the value 13."]
2419 pub ptxVersion: ::libc::c_int,
2420 #[doc = " The binary architecture version for which the function was compiled."]
2421 #[doc = " This value is the major binary version * 10 + the minor binary version,"]
2422 #[doc = " so a binary version 1.3 function would return the value 13."]
2423 pub binaryVersion: ::libc::c_int,
2424 #[doc = " The attribute to indicate whether the function has been compiled with"]
2425 #[doc = " user specified option \"-Xptxas --dlcm=ca\" set."]
2426 pub cacheModeCA: ::libc::c_int,
2427 #[doc = " The maximum size in bytes of dynamic shared memory per block for"]
2428 #[doc = " this function. Any launch must have a dynamic shared memory size"]
2429 #[doc = " smaller than this value."]
2430 pub maxDynamicSharedSizeBytes: ::libc::c_int,
2431 #[doc = " On devices where the L1 cache and shared memory use the same hardware resources,"]
2432 #[doc = " this sets the shared memory carveout preference, in percent of the maximum shared memory."]
2433 #[doc = " Refer to ::cudaDevAttrMaxSharedMemoryPerMultiprocessor."]
2434 #[doc = " This is only a hint, and the driver can choose a different ratio if required to execute the function."]
2435 #[doc = " See ::cudaFuncSetAttribute"]
2436 pub preferredShmemCarveout: ::libc::c_int,
2437}
2438#[test]
2439fn bindgen_test_layout_cudaFuncAttributes() {
2440 assert_eq!(
2441 ::std::mem::size_of::<cudaFuncAttributes>(),
2442 56usize,
2443 concat!("Size of: ", stringify!(cudaFuncAttributes))
2444 );
2445 assert_eq!(
2446 ::std::mem::align_of::<cudaFuncAttributes>(),
2447 8usize,
2448 concat!("Alignment of ", stringify!(cudaFuncAttributes))
2449 );
2450 assert_eq!(
2451 unsafe {
2452 &(*(::std::ptr::null::<cudaFuncAttributes>())).sharedSizeBytes as *const _ as usize
2453 },
2454 0usize,
2455 concat!(
2456 "Offset of field: ",
2457 stringify!(cudaFuncAttributes),
2458 "::",
2459 stringify!(sharedSizeBytes)
2460 )
2461 );
2462 assert_eq!(
2463 unsafe {
2464 &(*(::std::ptr::null::<cudaFuncAttributes>())).constSizeBytes as *const _ as usize
2465 },
2466 8usize,
2467 concat!(
2468 "Offset of field: ",
2469 stringify!(cudaFuncAttributes),
2470 "::",
2471 stringify!(constSizeBytes)
2472 )
2473 );
2474 assert_eq!(
2475 unsafe {
2476 &(*(::std::ptr::null::<cudaFuncAttributes>())).localSizeBytes as *const _ as usize
2477 },
2478 16usize,
2479 concat!(
2480 "Offset of field: ",
2481 stringify!(cudaFuncAttributes),
2482 "::",
2483 stringify!(localSizeBytes)
2484 )
2485 );
2486 assert_eq!(
2487 unsafe {
2488 &(*(::std::ptr::null::<cudaFuncAttributes>())).maxThreadsPerBlock as *const _ as usize
2489 },
2490 24usize,
2491 concat!(
2492 "Offset of field: ",
2493 stringify!(cudaFuncAttributes),
2494 "::",
2495 stringify!(maxThreadsPerBlock)
2496 )
2497 );
2498 assert_eq!(
2499 unsafe { &(*(::std::ptr::null::<cudaFuncAttributes>())).numRegs as *const _ as usize },
2500 28usize,
2501 concat!(
2502 "Offset of field: ",
2503 stringify!(cudaFuncAttributes),
2504 "::",
2505 stringify!(numRegs)
2506 )
2507 );
2508 assert_eq!(
2509 unsafe { &(*(::std::ptr::null::<cudaFuncAttributes>())).ptxVersion as *const _ as usize },
2510 32usize,
2511 concat!(
2512 "Offset of field: ",
2513 stringify!(cudaFuncAttributes),
2514 "::",
2515 stringify!(ptxVersion)
2516 )
2517 );
2518 assert_eq!(
2519 unsafe {
2520 &(*(::std::ptr::null::<cudaFuncAttributes>())).binaryVersion as *const _ as usize
2521 },
2522 36usize,
2523 concat!(
2524 "Offset of field: ",
2525 stringify!(cudaFuncAttributes),
2526 "::",
2527 stringify!(binaryVersion)
2528 )
2529 );
2530 assert_eq!(
2531 unsafe { &(*(::std::ptr::null::<cudaFuncAttributes>())).cacheModeCA as *const _ as usize },
2532 40usize,
2533 concat!(
2534 "Offset of field: ",
2535 stringify!(cudaFuncAttributes),
2536 "::",
2537 stringify!(cacheModeCA)
2538 )
2539 );
2540 assert_eq!(
2541 unsafe {
2542 &(*(::std::ptr::null::<cudaFuncAttributes>())).maxDynamicSharedSizeBytes as *const _
2543 as usize
2544 },
2545 44usize,
2546 concat!(
2547 "Offset of field: ",
2548 stringify!(cudaFuncAttributes),
2549 "::",
2550 stringify!(maxDynamicSharedSizeBytes)
2551 )
2552 );
2553 assert_eq!(
2554 unsafe {
2555 &(*(::std::ptr::null::<cudaFuncAttributes>())).preferredShmemCarveout as *const _
2556 as usize
2557 },
2558 48usize,
2559 concat!(
2560 "Offset of field: ",
2561 stringify!(cudaFuncAttributes),
2562 "::",
2563 stringify!(preferredShmemCarveout)
2564 )
2565 );
2566}
2567#[repr(u32)]
2568#[non_exhaustive]
2569#[doc = " CUDA function attributes that can be set using ::cudaFuncSetAttribute"]
2570#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2571pub enum cudaFuncAttribute {
2572 #[doc = "< Maximum dynamic shared memory size"]
2573 cudaFuncAttributeMaxDynamicSharedMemorySize = 8,
2574 #[doc = "< Preferred shared memory-L1 cache split"]
2575 cudaFuncAttributePreferredSharedMemoryCarveout = 9,
2576 cudaFuncAttributeMax = 10,
2577}
2578#[repr(u32)]
2579#[non_exhaustive]
2580#[doc = " CUDA function cache configurations"]
2581#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2582pub enum cudaFuncCache {
2583 #[doc = "< Default function cache configuration, no preference"]
2584 cudaFuncCachePreferNone = 0,
2585 #[doc = "< Prefer larger shared memory and smaller L1 cache"]
2586 cudaFuncCachePreferShared = 1,
2587 #[doc = "< Prefer larger L1 cache and smaller shared memory"]
2588 cudaFuncCachePreferL1 = 2,
2589 #[doc = "< Prefer equal size L1 cache and shared memory"]
2590 cudaFuncCachePreferEqual = 3,
2591}
2592#[repr(u32)]
2593#[non_exhaustive]
2594#[doc = " CUDA shared memory configuration"]
2595#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2596pub enum cudaSharedMemConfig {
2597 cudaSharedMemBankSizeDefault = 0,
2598 cudaSharedMemBankSizeFourByte = 1,
2599 cudaSharedMemBankSizeEightByte = 2,
2600}
2601#[repr(i32)]
2602#[non_exhaustive]
2603#[doc = " Shared memory carveout configurations. These may be passed to cudaFuncSetAttribute"]
2604#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2605pub enum cudaSharedCarveout {
2606 #[doc = "< No preference for shared memory or L1 (default)"]
2607 cudaSharedmemCarveoutDefault = -1,
2608 #[doc = "< Prefer maximum available shared memory, minimum L1 cache"]
2609 cudaSharedmemCarveoutMaxShared = 100,
2610 #[doc = "< Prefer maximum available L1 cache, minimum shared memory"]
2611 cudaSharedmemCarveoutMaxL1 = 0,
2612}
2613#[repr(u32)]
2614#[non_exhaustive]
2615#[doc = " CUDA device compute modes"]
2616#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2617pub enum cudaComputeMode {
2618 #[doc = "< Default compute mode (Multiple threads can use ::cudaSetDevice() with this device)"]
2619 cudaComputeModeDefault = 0,
2620 #[doc = "< Compute-exclusive-thread mode (Only one thread in one process will be able to use ::cudaSetDevice() with this device)"]
2621 cudaComputeModeExclusive = 1,
2622 #[doc = "< Compute-prohibited mode (No threads can use ::cudaSetDevice() with this device)"]
2623 cudaComputeModeProhibited = 2,
2624 #[doc = "< Compute-exclusive-process mode (Many threads in one process will be able to use ::cudaSetDevice() with this device)"]
2625 cudaComputeModeExclusiveProcess = 3,
2626}
2627#[repr(u32)]
2628#[non_exhaustive]
2629#[doc = " CUDA Limits"]
2630#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2631pub enum cudaLimit {
2632 #[doc = "< GPU thread stack size"]
2633 cudaLimitStackSize = 0,
2634 #[doc = "< GPU printf FIFO size"]
2635 cudaLimitPrintfFifoSize = 1,
2636 #[doc = "< GPU malloc heap size"]
2637 cudaLimitMallocHeapSize = 2,
2638 #[doc = "< GPU device runtime synchronize depth"]
2639 cudaLimitDevRuntimeSyncDepth = 3,
2640 #[doc = "< GPU device runtime pending launch count"]
2641 cudaLimitDevRuntimePendingLaunchCount = 4,
2642 #[doc = "< A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint"]
2643 cudaLimitMaxL2FetchGranularity = 5,
2644 #[doc = "< A size in bytes for L2 persisting lines cache size"]
2645 cudaLimitPersistingL2CacheSize = 6,
2646}
2647#[repr(u32)]
2648#[non_exhaustive]
2649#[doc = " CUDA Memory Advise values"]
2650#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2651pub enum cudaMemoryAdvise {
2652 #[doc = "< Data will mostly be read and only occassionally be written to"]
2653 cudaMemAdviseSetReadMostly = 1,
2654 #[doc = "< Undo the effect of ::cudaMemAdviseSetReadMostly"]
2655 cudaMemAdviseUnsetReadMostly = 2,
2656 #[doc = "< Set the preferred location for the data as the specified device"]
2657 cudaMemAdviseSetPreferredLocation = 3,
2658 #[doc = "< Clear the preferred location for the data"]
2659 cudaMemAdviseUnsetPreferredLocation = 4,
2660 #[doc = "< Data will be accessed by the specified device, so prevent page faults as much as possible"]
2661 cudaMemAdviseSetAccessedBy = 5,
2662 #[doc = "< Let the Unified Memory subsystem decide on the page faulting policy for the specified device"]
2663 cudaMemAdviseUnsetAccessedBy = 6,
2664}
2665#[repr(u32)]
2666#[non_exhaustive]
2667#[doc = " CUDA range attributes"]
2668#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2669pub enum cudaMemRangeAttribute {
2670 #[doc = "< Whether the range will mostly be read and only occassionally be written to"]
2671 cudaMemRangeAttributeReadMostly = 1,
2672 #[doc = "< The preferred location of the range"]
2673 cudaMemRangeAttributePreferredLocation = 2,
2674 #[doc = "< Memory range has ::cudaMemAdviseSetAccessedBy set for specified device"]
2675 cudaMemRangeAttributeAccessedBy = 3,
2676 #[doc = "< The last location to which the range was prefetched"]
2677 cudaMemRangeAttributeLastPrefetchLocation = 4,
2678}
2679#[repr(u32)]
2680#[non_exhaustive]
2681#[doc = " CUDA Profiler Output modes"]
2682#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2683pub enum cudaOutputMode {
2684 #[doc = "< Output mode Key-Value pair format."]
2685 cudaKeyValuePair = 0,
2686 #[doc = "< Output mode Comma separated values format."]
2687 cudaCSV = 1,
2688}
2689#[repr(u32)]
2690#[non_exhaustive]
2691#[doc = " CUDA GPUDirect RDMA flush writes APIs supported on the device"]
2692#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2693pub enum cudaFlushGPUDirectRDMAWritesOptions {
2694 #[doc = "< ::cudaDeviceFlushGPUDirectRDMAWrites() and its CUDA Driver API counterpart are supported on the device."]
2695 cudaFlushGPUDirectRDMAWritesOptionHost = 1,
2696 #[doc = "< The ::CU_STREAM_WAIT_VALUE_FLUSH flag and the ::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the CUDA device."]
2697 cudaFlushGPUDirectRDMAWritesOptionMemOps = 2,
2698}
2699#[repr(u32)]
2700#[non_exhaustive]
2701#[doc = " CUDA GPUDirect RDMA flush writes ordering features of the device"]
2702#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2703pub enum cudaGPUDirectRDMAWritesOrdering {
2704 #[doc = "< The device does not natively support ordering of GPUDirect RDMA writes. ::cudaFlushGPUDirectRDMAWrites() can be leveraged if supported."]
2705 cudaGPUDirectRDMAWritesOrderingNone = 0,
2706 #[doc = "< Natively, the device can consistently consume GPUDirect RDMA writes, although other CUDA devices may not."]
2707 cudaGPUDirectRDMAWritesOrderingOwner = 100,
2708 #[doc = "< Any CUDA device in the system can consistently consume GPUDirect RDMA writes to this device."]
2709 cudaGPUDirectRDMAWritesOrderingAllDevices = 200,
2710}
2711#[repr(u32)]
2712#[non_exhaustive]
2713#[doc = " CUDA GPUDirect RDMA flush writes scopes"]
2714#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2715pub enum cudaFlushGPUDirectRDMAWritesScope {
2716 #[doc = "< Blocks until remote writes are visible to the CUDA device context owning the data."]
2717 cudaFlushGPUDirectRDMAWritesToOwner = 100,
2718 #[doc = "< Blocks until remote writes are visible to all CUDA device contexts."]
2719 cudaFlushGPUDirectRDMAWritesToAllDevices = 200,
2720}
2721#[repr(u32)]
2722#[non_exhaustive]
2723#[doc = " CUDA GPUDirect RDMA flush writes targets"]
2724#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2725pub enum cudaFlushGPUDirectRDMAWritesTarget {
2726 #[doc = "< Sets the target for ::cudaDeviceFlushGPUDirectRDMAWrites() to the currently active CUDA device context."]
2727 cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = 0,
2728}
2729#[repr(u32)]
2730#[non_exhaustive]
2731#[doc = " CUDA device attributes"]
2732#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2733pub enum cudaDeviceAttr {
2734 #[doc = "< Maximum number of threads per block"]
2735 cudaDevAttrMaxThreadsPerBlock = 1,
2736 #[doc = "< Maximum block dimension X"]
2737 cudaDevAttrMaxBlockDimX = 2,
2738 #[doc = "< Maximum block dimension Y"]
2739 cudaDevAttrMaxBlockDimY = 3,
2740 #[doc = "< Maximum block dimension Z"]
2741 cudaDevAttrMaxBlockDimZ = 4,
2742 #[doc = "< Maximum grid dimension X"]
2743 cudaDevAttrMaxGridDimX = 5,
2744 #[doc = "< Maximum grid dimension Y"]
2745 cudaDevAttrMaxGridDimY = 6,
2746 #[doc = "< Maximum grid dimension Z"]
2747 cudaDevAttrMaxGridDimZ = 7,
2748 #[doc = "< Maximum shared memory available per block in bytes"]
2749 cudaDevAttrMaxSharedMemoryPerBlock = 8,
2750 #[doc = "< Memory available on device for __constant__ variables in a CUDA C kernel in bytes"]
2751 cudaDevAttrTotalConstantMemory = 9,
2752 #[doc = "< Warp size in threads"]
2753 cudaDevAttrWarpSize = 10,
2754 #[doc = "< Maximum pitch in bytes allowed by memory copies"]
2755 cudaDevAttrMaxPitch = 11,
2756 #[doc = "< Maximum number of 32-bit registers available per block"]
2757 cudaDevAttrMaxRegistersPerBlock = 12,
2758 #[doc = "< Peak clock frequency in kilohertz"]
2759 cudaDevAttrClockRate = 13,
2760 #[doc = "< Alignment requirement for textures"]
2761 cudaDevAttrTextureAlignment = 14,
2762 #[doc = "< Device can possibly copy memory and execute a kernel concurrently"]
2763 cudaDevAttrGpuOverlap = 15,
2764 #[doc = "< Number of multiprocessors on device"]
2765 cudaDevAttrMultiProcessorCount = 16,
2766 #[doc = "< Specifies whether there is a run time limit on kernels"]
2767 cudaDevAttrKernelExecTimeout = 17,
2768 #[doc = "< Device is integrated with host memory"]
2769 cudaDevAttrIntegrated = 18,
2770 #[doc = "< Device can map host memory into CUDA address space"]
2771 cudaDevAttrCanMapHostMemory = 19,
2772 #[doc = "< Compute mode (See ::cudaComputeMode for details)"]
2773 cudaDevAttrComputeMode = 20,
2774 #[doc = "< Maximum 1D texture width"]
2775 cudaDevAttrMaxTexture1DWidth = 21,
2776 #[doc = "< Maximum 2D texture width"]
2777 cudaDevAttrMaxTexture2DWidth = 22,
2778 #[doc = "< Maximum 2D texture height"]
2779 cudaDevAttrMaxTexture2DHeight = 23,
2780 #[doc = "< Maximum 3D texture width"]
2781 cudaDevAttrMaxTexture3DWidth = 24,
2782 #[doc = "< Maximum 3D texture height"]
2783 cudaDevAttrMaxTexture3DHeight = 25,
2784 #[doc = "< Maximum 3D texture depth"]
2785 cudaDevAttrMaxTexture3DDepth = 26,
2786 #[doc = "< Maximum 2D layered texture width"]
2787 cudaDevAttrMaxTexture2DLayeredWidth = 27,
2788 #[doc = "< Maximum 2D layered texture height"]
2789 cudaDevAttrMaxTexture2DLayeredHeight = 28,
2790 #[doc = "< Maximum layers in a 2D layered texture"]
2791 cudaDevAttrMaxTexture2DLayeredLayers = 29,
2792 #[doc = "< Alignment requirement for surfaces"]
2793 cudaDevAttrSurfaceAlignment = 30,
2794 #[doc = "< Device can possibly execute multiple kernels concurrently"]
2795 cudaDevAttrConcurrentKernels = 31,
2796 #[doc = "< Device has ECC support enabled"]
2797 cudaDevAttrEccEnabled = 32,
2798 #[doc = "< PCI bus ID of the device"]
2799 cudaDevAttrPciBusId = 33,
2800 #[doc = "< PCI device ID of the device"]
2801 cudaDevAttrPciDeviceId = 34,
2802 #[doc = "< Device is using TCC driver model"]
2803 cudaDevAttrTccDriver = 35,
2804 #[doc = "< Peak memory clock frequency in kilohertz"]
2805 cudaDevAttrMemoryClockRate = 36,
2806 #[doc = "< Global memory bus width in bits"]
2807 cudaDevAttrGlobalMemoryBusWidth = 37,
2808 #[doc = "< Size of L2 cache in bytes"]
2809 cudaDevAttrL2CacheSize = 38,
2810 #[doc = "< Maximum resident threads per multiprocessor"]
2811 cudaDevAttrMaxThreadsPerMultiProcessor = 39,
2812 #[doc = "< Number of asynchronous engines"]
2813 cudaDevAttrAsyncEngineCount = 40,
2814 #[doc = "< Device shares a unified address space with the host"]
2815 cudaDevAttrUnifiedAddressing = 41,
2816 #[doc = "< Maximum 1D layered texture width"]
2817 cudaDevAttrMaxTexture1DLayeredWidth = 42,
2818 #[doc = "< Maximum layers in a 1D layered texture"]
2819 cudaDevAttrMaxTexture1DLayeredLayers = 43,
2820 #[doc = "< Maximum 2D texture width if cudaArrayTextureGather is set"]
2821 cudaDevAttrMaxTexture2DGatherWidth = 45,
2822 #[doc = "< Maximum 2D texture height if cudaArrayTextureGather is set"]
2823 cudaDevAttrMaxTexture2DGatherHeight = 46,
2824 #[doc = "< Alternate maximum 3D texture width"]
2825 cudaDevAttrMaxTexture3DWidthAlt = 47,
2826 #[doc = "< Alternate maximum 3D texture height"]
2827 cudaDevAttrMaxTexture3DHeightAlt = 48,
2828 #[doc = "< Alternate maximum 3D texture depth"]
2829 cudaDevAttrMaxTexture3DDepthAlt = 49,
2830 #[doc = "< PCI domain ID of the device"]
2831 cudaDevAttrPciDomainId = 50,
2832 #[doc = "< Pitch alignment requirement for textures"]
2833 cudaDevAttrTexturePitchAlignment = 51,
2834 #[doc = "< Maximum cubemap texture width/height"]
2835 cudaDevAttrMaxTextureCubemapWidth = 52,
2836 #[doc = "< Maximum cubemap layered texture width/height"]
2837 cudaDevAttrMaxTextureCubemapLayeredWidth = 53,
2838 #[doc = "< Maximum layers in a cubemap layered texture"]
2839 cudaDevAttrMaxTextureCubemapLayeredLayers = 54,
2840 #[doc = "< Maximum 1D surface width"]
2841 cudaDevAttrMaxSurface1DWidth = 55,
2842 #[doc = "< Maximum 2D surface width"]
2843 cudaDevAttrMaxSurface2DWidth = 56,
2844 #[doc = "< Maximum 2D surface height"]
2845 cudaDevAttrMaxSurface2DHeight = 57,
2846 #[doc = "< Maximum 3D surface width"]
2847 cudaDevAttrMaxSurface3DWidth = 58,
2848 #[doc = "< Maximum 3D surface height"]
2849 cudaDevAttrMaxSurface3DHeight = 59,
2850 #[doc = "< Maximum 3D surface depth"]
2851 cudaDevAttrMaxSurface3DDepth = 60,
2852 #[doc = "< Maximum 1D layered surface width"]
2853 cudaDevAttrMaxSurface1DLayeredWidth = 61,
2854 #[doc = "< Maximum layers in a 1D layered surface"]
2855 cudaDevAttrMaxSurface1DLayeredLayers = 62,
2856 #[doc = "< Maximum 2D layered surface width"]
2857 cudaDevAttrMaxSurface2DLayeredWidth = 63,
2858 #[doc = "< Maximum 2D layered surface height"]
2859 cudaDevAttrMaxSurface2DLayeredHeight = 64,
2860 #[doc = "< Maximum layers in a 2D layered surface"]
2861 cudaDevAttrMaxSurface2DLayeredLayers = 65,
2862 #[doc = "< Maximum cubemap surface width"]
2863 cudaDevAttrMaxSurfaceCubemapWidth = 66,
2864 #[doc = "< Maximum cubemap layered surface width"]
2865 cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67,
2866 #[doc = "< Maximum layers in a cubemap layered surface"]
2867 cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68,
2868 #[doc = "< Maximum 1D linear texture width"]
2869 cudaDevAttrMaxTexture1DLinearWidth = 69,
2870 #[doc = "< Maximum 2D linear texture width"]
2871 cudaDevAttrMaxTexture2DLinearWidth = 70,
2872 #[doc = "< Maximum 2D linear texture height"]
2873 cudaDevAttrMaxTexture2DLinearHeight = 71,
2874 #[doc = "< Maximum 2D linear texture pitch in bytes"]
2875 cudaDevAttrMaxTexture2DLinearPitch = 72,
2876 #[doc = "< Maximum mipmapped 2D texture width"]
2877 cudaDevAttrMaxTexture2DMipmappedWidth = 73,
2878 #[doc = "< Maximum mipmapped 2D texture height"]
2879 cudaDevAttrMaxTexture2DMipmappedHeight = 74,
2880 #[doc = "< Major compute capability version number"]
2881 cudaDevAttrComputeCapabilityMajor = 75,
2882 #[doc = "< Minor compute capability version number"]
2883 cudaDevAttrComputeCapabilityMinor = 76,
2884 #[doc = "< Maximum mipmapped 1D texture width"]
2885 cudaDevAttrMaxTexture1DMipmappedWidth = 77,
2886 #[doc = "< Device supports stream priorities"]
2887 cudaDevAttrStreamPrioritiesSupported = 78,
2888 #[doc = "< Device supports caching globals in L1"]
2889 cudaDevAttrGlobalL1CacheSupported = 79,
2890 #[doc = "< Device supports caching locals in L1"]
2891 cudaDevAttrLocalL1CacheSupported = 80,
2892 #[doc = "< Maximum shared memory available per multiprocessor in bytes"]
2893 cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81,
2894 #[doc = "< Maximum number of 32-bit registers available per multiprocessor"]
2895 cudaDevAttrMaxRegistersPerMultiprocessor = 82,
2896 #[doc = "< Device can allocate managed memory on this system"]
2897 cudaDevAttrManagedMemory = 83,
2898 #[doc = "< Device is on a multi-GPU board"]
2899 cudaDevAttrIsMultiGpuBoard = 84,
2900 #[doc = "< Unique identifier for a group of devices on the same multi-GPU board"]
2901 cudaDevAttrMultiGpuBoardGroupID = 85,
2902 #[doc = "< Link between the device and the host supports native atomic operations"]
2903 cudaDevAttrHostNativeAtomicSupported = 86,
2904 #[doc = "< Ratio of single precision performance (in floating-point operations per second) to double precision performance"]
2905 cudaDevAttrSingleToDoublePrecisionPerfRatio = 87,
2906 #[doc = "< Device supports coherently accessing pageable memory without calling cudaHostRegister on it"]
2907 cudaDevAttrPageableMemoryAccess = 88,
2908 #[doc = "< Device can coherently access managed memory concurrently with the CPU"]
2909 cudaDevAttrConcurrentManagedAccess = 89,
2910 #[doc = "< Device supports Compute Preemption"]
2911 cudaDevAttrComputePreemptionSupported = 90,
2912 #[doc = "< Device can access host registered memory at the same virtual address as the CPU"]
2913 cudaDevAttrCanUseHostPointerForRegisteredMem = 91,
2914 cudaDevAttrReserved92 = 92,
2915 cudaDevAttrReserved93 = 93,
2916 cudaDevAttrReserved94 = 94,
2917 #[doc = "< Device supports launching cooperative kernels via ::cudaLaunchCooperativeKernel"]
2918 cudaDevAttrCooperativeLaunch = 95,
2919 #[doc = "< Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated."]
2920 cudaDevAttrCooperativeMultiDeviceLaunch = 96,
2921 #[doc = "< The maximum optin shared memory per block. This value may vary by chip. See ::cudaFuncSetAttribute"]
2922 cudaDevAttrMaxSharedMemoryPerBlockOptin = 97,
2923 #[doc = "< Device supports flushing of outstanding remote writes."]
2924 cudaDevAttrCanFlushRemoteWrites = 98,
2925 #[doc = "< Device supports host memory registration via ::cudaHostRegister."]
2926 cudaDevAttrHostRegisterSupported = 99,
2927 #[doc = "< Device accesses pageable memory via the host's page tables."]
2928 cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100,
2929 #[doc = "< Host can directly access managed memory on the device without migration."]
2930 cudaDevAttrDirectManagedMemAccessFromHost = 101,
2931 #[doc = "< Maximum number of blocks per multiprocessor"]
2932 cudaDevAttrMaxBlocksPerMultiprocessor = 106,
2933 #[doc = "< Maximum L2 persisting lines capacity setting in bytes."]
2934 cudaDevAttrMaxPersistingL2CacheSize = 108,
2935 #[doc = "< Maximum value of cudaAccessPolicyWindow::num_bytes."]
2936 cudaDevAttrMaxAccessPolicyWindowSize = 109,
2937 #[doc = "< Shared memory reserved by CUDA driver per block in bytes"]
2938 cudaDevAttrReservedSharedMemoryPerBlock = 111,
2939 #[doc = "< Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays"]
2940 cudaDevAttrSparseCudaArraySupported = 112,
2941 #[doc = "< Device supports using the ::cudaHostRegister flag cudaHostRegisterReadOnly to register memory that must be mapped as read-only to the GPU"]
2942 cudaDevAttrHostRegisterReadOnlySupported = 113,
2943 #[doc = "< External timeline semaphore interop is supported on the device"]
2944 cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114,
2945 #[doc = "< Device supports using the ::cudaMallocAsync and ::cudaMemPool family of APIs"]
2946 cudaDevAttrMemoryPoolsSupported = 115,
2947 #[doc = "< Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information)"]
2948 cudaDevAttrGPUDirectRDMASupported = 116,
2949 #[doc = "< The returned attribute shall be interpreted as a bitmask, where the individual bits are listed in the ::cudaFlushGPUDirectRDMAWritesOptions enum"]
2950 cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117,
2951 #[doc = "< GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute. See ::cudaGPUDirectRDMAWritesOrdering for the numerical values returned here."]
2952 cudaDevAttrGPUDirectRDMAWritesOrdering = 118,
2953 #[doc = "< Handle types supported with mempool based IPC"]
2954 cudaDevAttrMemoryPoolSupportedHandleTypes = 119,
2955 cudaDevAttrMax = 120,
2956}
2957#[repr(u32)]
2958#[non_exhaustive]
2959#[doc = " CUDA memory pool attributes"]
2960#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2961pub enum cudaMemPoolAttr {
2962 #[doc = " (value type = int)"]
2963 #[doc = " Allow cuMemAllocAsync to use memory asynchronously freed"]
2964 #[doc = " in another streams as long as a stream ordering dependency"]
2965 #[doc = " of the allocating stream on the free action exists."]
2966 #[doc = " Cuda events and null stream interactions can create the required"]
2967 #[doc = " stream ordered dependencies. (default enabled)"]
2968 cudaMemPoolReuseFollowEventDependencies = 1,
2969 #[doc = " (value type = int)"]
2970 #[doc = " Allow reuse of already completed frees when there is no dependency"]
2971 #[doc = " between the free and allocation. (default enabled)"]
2972 cudaMemPoolReuseAllowOpportunistic = 2,
2973 #[doc = " (value type = int)"]
2974 #[doc = " Allow cuMemAllocAsync to insert new stream dependencies"]
2975 #[doc = " in order to establish the stream ordering required to reuse"]
2976 #[doc = " a piece of memory released by cuFreeAsync (default enabled)."]
2977 cudaMemPoolReuseAllowInternalDependencies = 3,
2978 #[doc = " (value type = cuuint64_t)"]
2979 #[doc = " Amount of reserved memory in bytes to hold onto before trying"]
2980 #[doc = " to release memory back to the OS. When more than the release"]
2981 #[doc = " threshold bytes of memory are held by the memory pool, the"]
2982 #[doc = " allocator will try to release memory back to the OS on the"]
2983 #[doc = " next call to stream, event or context synchronize. (default 0)"]
2984 cudaMemPoolAttrReleaseThreshold = 4,
2985 #[doc = " (value type = cuuint64_t)"]
2986 #[doc = " Amount of backing memory currently allocated for the mempool."]
2987 cudaMemPoolAttrReservedMemCurrent = 5,
2988 #[doc = " (value type = cuuint64_t)"]
2989 #[doc = " High watermark of backing memory allocated for the mempool since the"]
2990 #[doc = " last time it was reset. High watermark can only be reset to zero."]
2991 cudaMemPoolAttrReservedMemHigh = 6,
2992 #[doc = " (value type = cuuint64_t)"]
2993 #[doc = " Amount of memory from the pool that is currently in use by the application."]
2994 cudaMemPoolAttrUsedMemCurrent = 7,
2995 #[doc = " (value type = cuuint64_t)"]
2996 #[doc = " High watermark of the amount of memory from the pool that was in use by the application since"]
2997 #[doc = " the last time it was reset. High watermark can only be reset to zero."]
2998 cudaMemPoolAttrUsedMemHigh = 8,
2999}
3000#[repr(u32)]
3001#[non_exhaustive]
3002#[doc = " Specifies the type of location"]
3003#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3004pub enum cudaMemLocationType {
3005 cudaMemLocationTypeInvalid = 0,
3006 #[doc = "< Location is a device location, thus id is a device ordinal"]
3007 cudaMemLocationTypeDevice = 1,
3008}
3009#[doc = " Specifies a memory location."]
3010#[doc = ""]
3011#[doc = " To specify a gpu, set type = ::cudaMemLocationTypeDevice and set id = the gpu's device ordinal."]
3012#[repr(C)]
3013#[derive(Debug, Copy, Clone)]
3014pub struct cudaMemLocation {
3015 #[doc = "< Specifies the location type, which modifies the meaning of id."]
3016 pub type_: cudaMemLocationType,
3017 #[doc = "< identifier for a given this location's ::CUmemLocationType."]
3018 pub id: ::libc::c_int,
3019}
3020#[test]
3021fn bindgen_test_layout_cudaMemLocation() {
3022 assert_eq!(
3023 ::std::mem::size_of::<cudaMemLocation>(),
3024 8usize,
3025 concat!("Size of: ", stringify!(cudaMemLocation))
3026 );
3027 assert_eq!(
3028 ::std::mem::align_of::<cudaMemLocation>(),
3029 4usize,
3030 concat!("Alignment of ", stringify!(cudaMemLocation))
3031 );
3032 assert_eq!(
3033 unsafe { &(*(::std::ptr::null::<cudaMemLocation>())).type_ as *const _ as usize },
3034 0usize,
3035 concat!(
3036 "Offset of field: ",
3037 stringify!(cudaMemLocation),
3038 "::",
3039 stringify!(type_)
3040 )
3041 );
3042 assert_eq!(
3043 unsafe { &(*(::std::ptr::null::<cudaMemLocation>())).id as *const _ as usize },
3044 4usize,
3045 concat!(
3046 "Offset of field: ",
3047 stringify!(cudaMemLocation),
3048 "::",
3049 stringify!(id)
3050 )
3051 );
3052}
3053#[repr(u32)]
3054#[non_exhaustive]
3055#[doc = " Specifies the memory protection flags for mapping."]
3056#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3057pub enum cudaMemAccessFlags {
3058 #[doc = "< Default, make the address range not accessible"]
3059 cudaMemAccessFlagsProtNone = 0,
3060 #[doc = "< Make the address range read accessible"]
3061 cudaMemAccessFlagsProtRead = 1,
3062 #[doc = "< Make the address range read-write accessible"]
3063 cudaMemAccessFlagsProtReadWrite = 3,
3064}
3065#[doc = " Memory access descriptor"]
3066#[repr(C)]
3067#[derive(Debug, Copy, Clone)]
3068pub struct cudaMemAccessDesc {
3069 #[doc = "< Location on which the request is to change it's accessibility"]
3070 pub location: cudaMemLocation,
3071 #[doc = "< ::CUmemProt accessibility flags to set on the request"]
3072 pub flags: cudaMemAccessFlags,
3073}
3074#[test]
3075fn bindgen_test_layout_cudaMemAccessDesc() {
3076 assert_eq!(
3077 ::std::mem::size_of::<cudaMemAccessDesc>(),
3078 12usize,
3079 concat!("Size of: ", stringify!(cudaMemAccessDesc))
3080 );
3081 assert_eq!(
3082 ::std::mem::align_of::<cudaMemAccessDesc>(),
3083 4usize,
3084 concat!("Alignment of ", stringify!(cudaMemAccessDesc))
3085 );
3086 assert_eq!(
3087 unsafe { &(*(::std::ptr::null::<cudaMemAccessDesc>())).location as *const _ as usize },
3088 0usize,
3089 concat!(
3090 "Offset of field: ",
3091 stringify!(cudaMemAccessDesc),
3092 "::",
3093 stringify!(location)
3094 )
3095 );
3096 assert_eq!(
3097 unsafe { &(*(::std::ptr::null::<cudaMemAccessDesc>())).flags as *const _ as usize },
3098 8usize,
3099 concat!(
3100 "Offset of field: ",
3101 stringify!(cudaMemAccessDesc),
3102 "::",
3103 stringify!(flags)
3104 )
3105 );
3106}
3107#[repr(u32)]
3108#[non_exhaustive]
3109#[doc = " Defines the allocation types available"]
3110#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3111pub enum cudaMemAllocationType {
3112 cudaMemAllocationTypeInvalid = 0,
3113 #[doc = " This allocation type is 'pinned', i.e. cannot migrate from its current"]
3114 #[doc = " location while the application is actively using it"]
3115 cudaMemAllocationTypePinned = 1,
3116 #[doc = " This allocation type is 'pinned', i.e. cannot migrate from its current"]
3117 #[doc = " location while the application is actively using it"]
3118 cudaMemAllocationTypeMax = 2147483647,
3119}
3120#[repr(u32)]
3121#[non_exhaustive]
3122#[doc = " Flags for specifying particular handle types"]
3123#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3124pub enum cudaMemAllocationHandleType {
3125 #[doc = "< Does not allow any export mechanism. >"]
3126 cudaMemHandleTypeNone = 0,
3127 #[doc = "< Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int)"]
3128 cudaMemHandleTypePosixFileDescriptor = 1,
3129 #[doc = "< Allows a Win32 NT handle to be used for exporting. (HANDLE)"]
3130 cudaMemHandleTypeWin32 = 2,
3131 #[doc = "< Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE)"]
3132 cudaMemHandleTypeWin32Kmt = 4,
3133}
3134#[doc = " Specifies the properties of allocations made from the pool."]
3135#[repr(C)]
3136#[derive(Copy, Clone)]
3137pub struct cudaMemPoolProps {
3138 #[doc = "< Allocation type. Currently must be specified as cudaMemAllocationTypePinned"]
3139 pub allocType: cudaMemAllocationType,
3140 #[doc = "< Handle types that will be supported by allocations from the pool."]
3141 pub handleTypes: cudaMemAllocationHandleType,
3142 #[doc = "< Location allocations should reside."]
3143 pub location: cudaMemLocation,
3144 #[doc = " Windows-specific LPSECURITYATTRIBUTES required when"]
3145 #[doc = " ::cudaMemHandleTypeWin32 is specified. This security attribute defines"]
3146 #[doc = " the scope of which exported allocations may be tranferred to other"]
3147 #[doc = " processes. In all other cases, this field is required to be zero."]
3148 pub win32SecurityAttributes: *mut ::libc::c_void,
3149 #[doc = "< reserved for future use, must be 0"]
3150 pub reserved: [::libc::c_uchar; 64usize],
3151}
3152#[test]
3153fn bindgen_test_layout_cudaMemPoolProps() {
3154 assert_eq!(
3155 ::std::mem::size_of::<cudaMemPoolProps>(),
3156 88usize,
3157 concat!("Size of: ", stringify!(cudaMemPoolProps))
3158 );
3159 assert_eq!(
3160 ::std::mem::align_of::<cudaMemPoolProps>(),
3161 8usize,
3162 concat!("Alignment of ", stringify!(cudaMemPoolProps))
3163 );
3164 assert_eq!(
3165 unsafe { &(*(::std::ptr::null::<cudaMemPoolProps>())).allocType as *const _ as usize },
3166 0usize,
3167 concat!(
3168 "Offset of field: ",
3169 stringify!(cudaMemPoolProps),
3170 "::",
3171 stringify!(allocType)
3172 )
3173 );
3174 assert_eq!(
3175 unsafe { &(*(::std::ptr::null::<cudaMemPoolProps>())).handleTypes as *const _ as usize },
3176 4usize,
3177 concat!(
3178 "Offset of field: ",
3179 stringify!(cudaMemPoolProps),
3180 "::",
3181 stringify!(handleTypes)
3182 )
3183 );
3184 assert_eq!(
3185 unsafe { &(*(::std::ptr::null::<cudaMemPoolProps>())).location as *const _ as usize },
3186 8usize,
3187 concat!(
3188 "Offset of field: ",
3189 stringify!(cudaMemPoolProps),
3190 "::",
3191 stringify!(location)
3192 )
3193 );
3194 assert_eq!(
3195 unsafe {
3196 &(*(::std::ptr::null::<cudaMemPoolProps>())).win32SecurityAttributes as *const _
3197 as usize
3198 },
3199 16usize,
3200 concat!(
3201 "Offset of field: ",
3202 stringify!(cudaMemPoolProps),
3203 "::",
3204 stringify!(win32SecurityAttributes)
3205 )
3206 );
3207 assert_eq!(
3208 unsafe { &(*(::std::ptr::null::<cudaMemPoolProps>())).reserved as *const _ as usize },
3209 24usize,
3210 concat!(
3211 "Offset of field: ",
3212 stringify!(cudaMemPoolProps),
3213 "::",
3214 stringify!(reserved)
3215 )
3216 );
3217}
3218#[doc = " Opaque data for exporting a pool allocation"]
3219#[repr(C)]
3220#[derive(Copy, Clone)]
3221pub struct cudaMemPoolPtrExportData {
3222 pub reserved: [::libc::c_uchar; 64usize],
3223}
3224#[test]
3225fn bindgen_test_layout_cudaMemPoolPtrExportData() {
3226 assert_eq!(
3227 ::std::mem::size_of::<cudaMemPoolPtrExportData>(),
3228 64usize,
3229 concat!("Size of: ", stringify!(cudaMemPoolPtrExportData))
3230 );
3231 assert_eq!(
3232 ::std::mem::align_of::<cudaMemPoolPtrExportData>(),
3233 1usize,
3234 concat!("Alignment of ", stringify!(cudaMemPoolPtrExportData))
3235 );
3236 assert_eq!(
3237 unsafe {
3238 &(*(::std::ptr::null::<cudaMemPoolPtrExportData>())).reserved as *const _ as usize
3239 },
3240 0usize,
3241 concat!(
3242 "Offset of field: ",
3243 stringify!(cudaMemPoolPtrExportData),
3244 "::",
3245 stringify!(reserved)
3246 )
3247 );
3248}
3249#[doc = " Memory allocation node parameters"]
3250#[repr(C)]
3251#[derive(Copy, Clone)]
3252pub struct cudaMemAllocNodeParams {
3253 #[doc = "< in: array of memory access descriptors. Used to describe peer GPU access"]
3254 pub poolProps: cudaMemPoolProps,
3255 #[doc = "< in: number of memory access descriptors. Must not exceed the number of GPUs."]
3256 pub accessDescs: *const cudaMemAccessDesc,
3257 #[doc = "< in: Number of `accessDescs`s"]
3258 pub accessDescCount: usize,
3259 #[doc = "< in: size in bytes of the requested allocation"]
3260 pub bytesize: usize,
3261 #[doc = "< out: address of the allocation returned by CUDA"]
3262 pub dptr: *mut ::libc::c_void,
3263}
3264#[test]
3265fn bindgen_test_layout_cudaMemAllocNodeParams() {
3266 assert_eq!(
3267 ::std::mem::size_of::<cudaMemAllocNodeParams>(),
3268 120usize,
3269 concat!("Size of: ", stringify!(cudaMemAllocNodeParams))
3270 );
3271 assert_eq!(
3272 ::std::mem::align_of::<cudaMemAllocNodeParams>(),
3273 8usize,
3274 concat!("Alignment of ", stringify!(cudaMemAllocNodeParams))
3275 );
3276 assert_eq!(
3277 unsafe {
3278 &(*(::std::ptr::null::<cudaMemAllocNodeParams>())).poolProps as *const _ as usize
3279 },
3280 0usize,
3281 concat!(
3282 "Offset of field: ",
3283 stringify!(cudaMemAllocNodeParams),
3284 "::",
3285 stringify!(poolProps)
3286 )
3287 );
3288 assert_eq!(
3289 unsafe {
3290 &(*(::std::ptr::null::<cudaMemAllocNodeParams>())).accessDescs as *const _ as usize
3291 },
3292 88usize,
3293 concat!(
3294 "Offset of field: ",
3295 stringify!(cudaMemAllocNodeParams),
3296 "::",
3297 stringify!(accessDescs)
3298 )
3299 );
3300 assert_eq!(
3301 unsafe {
3302 &(*(::std::ptr::null::<cudaMemAllocNodeParams>())).accessDescCount as *const _ as usize
3303 },
3304 96usize,
3305 concat!(
3306 "Offset of field: ",
3307 stringify!(cudaMemAllocNodeParams),
3308 "::",
3309 stringify!(accessDescCount)
3310 )
3311 );
3312 assert_eq!(
3313 unsafe { &(*(::std::ptr::null::<cudaMemAllocNodeParams>())).bytesize as *const _ as usize },
3314 104usize,
3315 concat!(
3316 "Offset of field: ",
3317 stringify!(cudaMemAllocNodeParams),
3318 "::",
3319 stringify!(bytesize)
3320 )
3321 );
3322 assert_eq!(
3323 unsafe { &(*(::std::ptr::null::<cudaMemAllocNodeParams>())).dptr as *const _ as usize },
3324 112usize,
3325 concat!(
3326 "Offset of field: ",
3327 stringify!(cudaMemAllocNodeParams),
3328 "::",
3329 stringify!(dptr)
3330 )
3331 );
3332}
3333#[repr(u32)]
3334#[non_exhaustive]
3335#[doc = " Graph memory attributes"]
3336#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3337pub enum cudaGraphMemAttributeType {
3338 #[doc = " (value type = cuuint64_t)"]
3339 #[doc = " Amount of memory, in bytes, currently associated with graphs."]
3340 cudaGraphMemAttrUsedMemCurrent = 1,
3341 #[doc = " (value type = cuuint64_t)"]
3342 #[doc = " High watermark of memory, in bytes, associated with graphs since the"]
3343 #[doc = " last time it was reset. High watermark can only be reset to zero."]
3344 cudaGraphMemAttrUsedMemHigh = 2,
3345 #[doc = " (value type = cuuint64_t)"]
3346 #[doc = " Amount of memory, in bytes, currently allocated for use by"]
3347 #[doc = " the CUDA graphs asynchronous allocator."]
3348 cudaGraphMemAttrReservedMemCurrent = 3,
3349 #[doc = " (value type = cuuint64_t)"]
3350 #[doc = " High watermark of memory, in bytes, currently allocated for use by"]
3351 #[doc = " the CUDA graphs asynchronous allocator."]
3352 cudaGraphMemAttrReservedMemHigh = 4,
3353}
3354#[repr(u32)]
3355#[non_exhaustive]
3356#[doc = " CUDA device P2P attributes"]
3357#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3358pub enum cudaDeviceP2PAttr {
3359 #[doc = "< A relative value indicating the performance of the link between two devices"]
3360 cudaDevP2PAttrPerformanceRank = 1,
3361 #[doc = "< Peer access is enabled"]
3362 cudaDevP2PAttrAccessSupported = 2,
3363 #[doc = "< Native atomic operation over the link supported"]
3364 cudaDevP2PAttrNativeAtomicSupported = 3,
3365 #[doc = "< Accessing CUDA arrays over the link supported"]
3366 cudaDevP2PAttrCudaArrayAccessSupported = 4,
3367}
3368#[repr(C)]
3369#[derive(Debug, Copy, Clone)]
3370pub struct CUuuid_st {
3371 pub bytes: [::libc::c_char; 16usize],
3372}
3373#[test]
3374fn bindgen_test_layout_CUuuid_st() {
3375 assert_eq!(
3376 ::std::mem::size_of::<CUuuid_st>(),
3377 16usize,
3378 concat!("Size of: ", stringify!(CUuuid_st))
3379 );
3380 assert_eq!(
3381 ::std::mem::align_of::<CUuuid_st>(),
3382 1usize,
3383 concat!("Alignment of ", stringify!(CUuuid_st))
3384 );
3385 assert_eq!(
3386 unsafe { &(*(::std::ptr::null::<CUuuid_st>())).bytes as *const _ as usize },
3387 0usize,
3388 concat!(
3389 "Offset of field: ",
3390 stringify!(CUuuid_st),
3391 "::",
3392 stringify!(bytes)
3393 )
3394 );
3395}
3396pub type CUuuid = CUuuid_st;
3397pub type cudaUUID_t = CUuuid_st;
3398#[doc = " CUDA device properties"]
3399#[repr(C)]
3400#[derive(Copy, Clone)]
3401pub struct cudaDeviceProp {
3402 #[doc = "< ASCII string identifying device"]
3403 pub name: [::libc::c_char; 256usize],
3404 #[doc = "< 16-byte unique identifier"]
3405 pub uuid: cudaUUID_t,
3406 #[doc = "< 8-byte locally unique identifier. Value is undefined on TCC and non-Windows platforms"]
3407 pub luid: [::libc::c_char; 8usize],
3408 #[doc = "< LUID device node mask. Value is undefined on TCC and non-Windows platforms"]
3409 pub luidDeviceNodeMask: ::libc::c_uint,
3410 #[doc = "< Global memory available on device in bytes"]
3411 pub totalGlobalMem: usize,
3412 #[doc = "< Shared memory available per block in bytes"]
3413 pub sharedMemPerBlock: usize,
3414 #[doc = "< 32-bit registers available per block"]
3415 pub regsPerBlock: ::libc::c_int,
3416 #[doc = "< Warp size in threads"]
3417 pub warpSize: ::libc::c_int,
3418 #[doc = "< Maximum pitch in bytes allowed by memory copies"]
3419 pub memPitch: usize,
3420 #[doc = "< Maximum number of threads per block"]
3421 pub maxThreadsPerBlock: ::libc::c_int,
3422 #[doc = "< Maximum size of each dimension of a block"]
3423 pub maxThreadsDim: [::libc::c_int; 3usize],
3424 #[doc = "< Maximum size of each dimension of a grid"]
3425 pub maxGridSize: [::libc::c_int; 3usize],
3426 #[doc = "< Clock frequency in kilohertz"]
3427 pub clockRate: ::libc::c_int,
3428 #[doc = "< Constant memory available on device in bytes"]
3429 pub totalConstMem: usize,
3430 #[doc = "< Major compute capability"]
3431 pub major: ::libc::c_int,
3432 #[doc = "< Minor compute capability"]
3433 pub minor: ::libc::c_int,
3434 #[doc = "< Alignment requirement for textures"]
3435 pub textureAlignment: usize,
3436 #[doc = "< Pitch alignment requirement for texture references bound to pitched memory"]
3437 pub texturePitchAlignment: usize,
3438 #[doc = "< Device can concurrently copy memory and execute a kernel. Deprecated. Use instead asyncEngineCount."]
3439 pub deviceOverlap: ::libc::c_int,
3440 #[doc = "< Number of multiprocessors on device"]
3441 pub multiProcessorCount: ::libc::c_int,
3442 #[doc = "< Specified whether there is a run time limit on kernels"]
3443 pub kernelExecTimeoutEnabled: ::libc::c_int,
3444 #[doc = "< Device is integrated as opposed to discrete"]
3445 pub integrated: ::libc::c_int,
3446 #[doc = "< Device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer"]
3447 pub canMapHostMemory: ::libc::c_int,
3448 #[doc = "< Compute mode (See ::cudaComputeMode)"]
3449 pub computeMode: ::libc::c_int,
3450 #[doc = "< Maximum 1D texture size"]
3451 pub maxTexture1D: ::libc::c_int,
3452 #[doc = "< Maximum 1D mipmapped texture size"]
3453 pub maxTexture1DMipmap: ::libc::c_int,
3454 #[doc = "< Deprecated, do not use. Use cudaDeviceGetTexture1DLinearMaxWidth() or cuDeviceGetTexture1DLinearMaxWidth() instead."]
3455 pub maxTexture1DLinear: ::libc::c_int,
3456 #[doc = "< Maximum 2D texture dimensions"]
3457 pub maxTexture2D: [::libc::c_int; 2usize],
3458 #[doc = "< Maximum 2D mipmapped texture dimensions"]
3459 pub maxTexture2DMipmap: [::libc::c_int; 2usize],
3460 #[doc = "< Maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory"]
3461 pub maxTexture2DLinear: [::libc::c_int; 3usize],
3462 #[doc = "< Maximum 2D texture dimensions if texture gather operations have to be performed"]
3463 pub maxTexture2DGather: [::libc::c_int; 2usize],
3464 #[doc = "< Maximum 3D texture dimensions"]
3465 pub maxTexture3D: [::libc::c_int; 3usize],
3466 #[doc = "< Maximum alternate 3D texture dimensions"]
3467 pub maxTexture3DAlt: [::libc::c_int; 3usize],
3468 #[doc = "< Maximum Cubemap texture dimensions"]
3469 pub maxTextureCubemap: ::libc::c_int,
3470 #[doc = "< Maximum 1D layered texture dimensions"]
3471 pub maxTexture1DLayered: [::libc::c_int; 2usize],
3472 #[doc = "< Maximum 2D layered texture dimensions"]
3473 pub maxTexture2DLayered: [::libc::c_int; 3usize],
3474 #[doc = "< Maximum Cubemap layered texture dimensions"]
3475 pub maxTextureCubemapLayered: [::libc::c_int; 2usize],
3476 #[doc = "< Maximum 1D surface size"]
3477 pub maxSurface1D: ::libc::c_int,
3478 #[doc = "< Maximum 2D surface dimensions"]
3479 pub maxSurface2D: [::libc::c_int; 2usize],
3480 #[doc = "< Maximum 3D surface dimensions"]
3481 pub maxSurface3D: [::libc::c_int; 3usize],
3482 #[doc = "< Maximum 1D layered surface dimensions"]
3483 pub maxSurface1DLayered: [::libc::c_int; 2usize],
3484 #[doc = "< Maximum 2D layered surface dimensions"]
3485 pub maxSurface2DLayered: [::libc::c_int; 3usize],
3486 #[doc = "< Maximum Cubemap surface dimensions"]
3487 pub maxSurfaceCubemap: ::libc::c_int,
3488 #[doc = "< Maximum Cubemap layered surface dimensions"]
3489 pub maxSurfaceCubemapLayered: [::libc::c_int; 2usize],
3490 #[doc = "< Alignment requirements for surfaces"]
3491 pub surfaceAlignment: usize,
3492 #[doc = "< Device can possibly execute multiple kernels concurrently"]
3493 pub concurrentKernels: ::libc::c_int,
3494 #[doc = "< Device has ECC support enabled"]
3495 pub ECCEnabled: ::libc::c_int,
3496 #[doc = "< PCI bus ID of the device"]
3497 pub pciBusID: ::libc::c_int,
3498 #[doc = "< PCI device ID of the device"]
3499 pub pciDeviceID: ::libc::c_int,
3500 #[doc = "< PCI domain ID of the device"]
3501 pub pciDomainID: ::libc::c_int,
3502 #[doc = "< 1 if device is a Tesla device using TCC driver, 0 otherwise"]
3503 pub tccDriver: ::libc::c_int,
3504 #[doc = "< Number of asynchronous engines"]
3505 pub asyncEngineCount: ::libc::c_int,
3506 #[doc = "< Device shares a unified address space with the host"]
3507 pub unifiedAddressing: ::libc::c_int,
3508 #[doc = "< Peak memory clock frequency in kilohertz"]
3509 pub memoryClockRate: ::libc::c_int,
3510 #[doc = "< Global memory bus width in bits"]
3511 pub memoryBusWidth: ::libc::c_int,
3512 #[doc = "< Size of L2 cache in bytes"]
3513 pub l2CacheSize: ::libc::c_int,
3514 #[doc = "< Device's maximum l2 persisting lines capacity setting in bytes"]
3515 pub persistingL2CacheMaxSize: ::libc::c_int,
3516 #[doc = "< Maximum resident threads per multiprocessor"]
3517 pub maxThreadsPerMultiProcessor: ::libc::c_int,
3518 #[doc = "< Device supports stream priorities"]
3519 pub streamPrioritiesSupported: ::libc::c_int,
3520 #[doc = "< Device supports caching globals in L1"]
3521 pub globalL1CacheSupported: ::libc::c_int,
3522 #[doc = "< Device supports caching locals in L1"]
3523 pub localL1CacheSupported: ::libc::c_int,
3524 #[doc = "< Shared memory available per multiprocessor in bytes"]
3525 pub sharedMemPerMultiprocessor: usize,
3526 #[doc = "< 32-bit registers available per multiprocessor"]
3527 pub regsPerMultiprocessor: ::libc::c_int,
3528 #[doc = "< Device supports allocating managed memory on this system"]
3529 pub managedMemory: ::libc::c_int,
3530 #[doc = "< Device is on a multi-GPU board"]
3531 pub isMultiGpuBoard: ::libc::c_int,
3532 #[doc = "< Unique identifier for a group of devices on the same multi-GPU board"]
3533 pub multiGpuBoardGroupID: ::libc::c_int,
3534 #[doc = "< Link between the device and the host supports native atomic operations"]
3535 pub hostNativeAtomicSupported: ::libc::c_int,
3536 #[doc = "< Ratio of single precision performance (in floating-point operations per second) to double precision performance"]
3537 pub singleToDoublePrecisionPerfRatio: ::libc::c_int,
3538 #[doc = "< Device supports coherently accessing pageable memory without calling cudaHostRegister on it"]
3539 pub pageableMemoryAccess: ::libc::c_int,
3540 #[doc = "< Device can coherently access managed memory concurrently with the CPU"]
3541 pub concurrentManagedAccess: ::libc::c_int,
3542 #[doc = "< Device supports Compute Preemption"]
3543 pub computePreemptionSupported: ::libc::c_int,
3544 #[doc = "< Device can access host registered memory at the same virtual address as the CPU"]
3545 pub canUseHostPointerForRegisteredMem: ::libc::c_int,
3546 #[doc = "< Device supports launching cooperative kernels via ::cudaLaunchCooperativeKernel"]
3547 pub cooperativeLaunch: ::libc::c_int,
3548 #[doc = "< Deprecated, cudaLaunchCooperativeKernelMultiDevice is deprecated."]
3549 pub cooperativeMultiDeviceLaunch: ::libc::c_int,
3550 #[doc = "< Per device maximum shared memory per block usable by special opt in"]
3551 pub sharedMemPerBlockOptin: usize,
3552 #[doc = "< Device accesses pageable memory via the host's page tables"]
3553 pub pageableMemoryAccessUsesHostPageTables: ::libc::c_int,
3554 #[doc = "< Host can directly access managed memory on the device without migration."]
3555 pub directManagedMemAccessFromHost: ::libc::c_int,
3556 #[doc = "< Maximum number of resident blocks per multiprocessor"]
3557 pub maxBlocksPerMultiProcessor: ::libc::c_int,
3558 #[doc = "< The maximum value of ::cudaAccessPolicyWindow::num_bytes."]
3559 pub accessPolicyMaxWindowSize: ::libc::c_int,
3560 #[doc = "< Shared memory reserved by CUDA driver per block in bytes"]
3561 pub reservedSharedMemPerBlock: usize,
3562}
3563#[test]
3564fn bindgen_test_layout_cudaDeviceProp() {
3565 assert_eq!(
3566 ::std::mem::size_of::<cudaDeviceProp>(),
3567 728usize,
3568 concat!("Size of: ", stringify!(cudaDeviceProp))
3569 );
3570 assert_eq!(
3571 ::std::mem::align_of::<cudaDeviceProp>(),
3572 8usize,
3573 concat!("Alignment of ", stringify!(cudaDeviceProp))
3574 );
3575 assert_eq!(
3576 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).name as *const _ as usize },
3577 0usize,
3578 concat!(
3579 "Offset of field: ",
3580 stringify!(cudaDeviceProp),
3581 "::",
3582 stringify!(name)
3583 )
3584 );
3585 assert_eq!(
3586 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).uuid as *const _ as usize },
3587 256usize,
3588 concat!(
3589 "Offset of field: ",
3590 stringify!(cudaDeviceProp),
3591 "::",
3592 stringify!(uuid)
3593 )
3594 );
3595 assert_eq!(
3596 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).luid as *const _ as usize },
3597 272usize,
3598 concat!(
3599 "Offset of field: ",
3600 stringify!(cudaDeviceProp),
3601 "::",
3602 stringify!(luid)
3603 )
3604 );
3605 assert_eq!(
3606 unsafe {
3607 &(*(::std::ptr::null::<cudaDeviceProp>())).luidDeviceNodeMask as *const _ as usize
3608 },
3609 280usize,
3610 concat!(
3611 "Offset of field: ",
3612 stringify!(cudaDeviceProp),
3613 "::",
3614 stringify!(luidDeviceNodeMask)
3615 )
3616 );
3617 assert_eq!(
3618 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).totalGlobalMem as *const _ as usize },
3619 288usize,
3620 concat!(
3621 "Offset of field: ",
3622 stringify!(cudaDeviceProp),
3623 "::",
3624 stringify!(totalGlobalMem)
3625 )
3626 );
3627 assert_eq!(
3628 unsafe {
3629 &(*(::std::ptr::null::<cudaDeviceProp>())).sharedMemPerBlock as *const _ as usize
3630 },
3631 296usize,
3632 concat!(
3633 "Offset of field: ",
3634 stringify!(cudaDeviceProp),
3635 "::",
3636 stringify!(sharedMemPerBlock)
3637 )
3638 );
3639 assert_eq!(
3640 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).regsPerBlock as *const _ as usize },
3641 304usize,
3642 concat!(
3643 "Offset of field: ",
3644 stringify!(cudaDeviceProp),
3645 "::",
3646 stringify!(regsPerBlock)
3647 )
3648 );
3649 assert_eq!(
3650 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).warpSize as *const _ as usize },
3651 308usize,
3652 concat!(
3653 "Offset of field: ",
3654 stringify!(cudaDeviceProp),
3655 "::",
3656 stringify!(warpSize)
3657 )
3658 );
3659 assert_eq!(
3660 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).memPitch as *const _ as usize },
3661 312usize,
3662 concat!(
3663 "Offset of field: ",
3664 stringify!(cudaDeviceProp),
3665 "::",
3666 stringify!(memPitch)
3667 )
3668 );
3669 assert_eq!(
3670 unsafe {
3671 &(*(::std::ptr::null::<cudaDeviceProp>())).maxThreadsPerBlock as *const _ as usize
3672 },
3673 320usize,
3674 concat!(
3675 "Offset of field: ",
3676 stringify!(cudaDeviceProp),
3677 "::",
3678 stringify!(maxThreadsPerBlock)
3679 )
3680 );
3681 assert_eq!(
3682 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxThreadsDim as *const _ as usize },
3683 324usize,
3684 concat!(
3685 "Offset of field: ",
3686 stringify!(cudaDeviceProp),
3687 "::",
3688 stringify!(maxThreadsDim)
3689 )
3690 );
3691 assert_eq!(
3692 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxGridSize as *const _ as usize },
3693 336usize,
3694 concat!(
3695 "Offset of field: ",
3696 stringify!(cudaDeviceProp),
3697 "::",
3698 stringify!(maxGridSize)
3699 )
3700 );
3701 assert_eq!(
3702 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).clockRate as *const _ as usize },
3703 348usize,
3704 concat!(
3705 "Offset of field: ",
3706 stringify!(cudaDeviceProp),
3707 "::",
3708 stringify!(clockRate)
3709 )
3710 );
3711 assert_eq!(
3712 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).totalConstMem as *const _ as usize },
3713 352usize,
3714 concat!(
3715 "Offset of field: ",
3716 stringify!(cudaDeviceProp),
3717 "::",
3718 stringify!(totalConstMem)
3719 )
3720 );
3721 assert_eq!(
3722 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).major as *const _ as usize },
3723 360usize,
3724 concat!(
3725 "Offset of field: ",
3726 stringify!(cudaDeviceProp),
3727 "::",
3728 stringify!(major)
3729 )
3730 );
3731 assert_eq!(
3732 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).minor as *const _ as usize },
3733 364usize,
3734 concat!(
3735 "Offset of field: ",
3736 stringify!(cudaDeviceProp),
3737 "::",
3738 stringify!(minor)
3739 )
3740 );
3741 assert_eq!(
3742 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).textureAlignment as *const _ as usize },
3743 368usize,
3744 concat!(
3745 "Offset of field: ",
3746 stringify!(cudaDeviceProp),
3747 "::",
3748 stringify!(textureAlignment)
3749 )
3750 );
3751 assert_eq!(
3752 unsafe {
3753 &(*(::std::ptr::null::<cudaDeviceProp>())).texturePitchAlignment as *const _ as usize
3754 },
3755 376usize,
3756 concat!(
3757 "Offset of field: ",
3758 stringify!(cudaDeviceProp),
3759 "::",
3760 stringify!(texturePitchAlignment)
3761 )
3762 );
3763 assert_eq!(
3764 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).deviceOverlap as *const _ as usize },
3765 384usize,
3766 concat!(
3767 "Offset of field: ",
3768 stringify!(cudaDeviceProp),
3769 "::",
3770 stringify!(deviceOverlap)
3771 )
3772 );
3773 assert_eq!(
3774 unsafe {
3775 &(*(::std::ptr::null::<cudaDeviceProp>())).multiProcessorCount as *const _ as usize
3776 },
3777 388usize,
3778 concat!(
3779 "Offset of field: ",
3780 stringify!(cudaDeviceProp),
3781 "::",
3782 stringify!(multiProcessorCount)
3783 )
3784 );
3785 assert_eq!(
3786 unsafe {
3787 &(*(::std::ptr::null::<cudaDeviceProp>())).kernelExecTimeoutEnabled as *const _ as usize
3788 },
3789 392usize,
3790 concat!(
3791 "Offset of field: ",
3792 stringify!(cudaDeviceProp),
3793 "::",
3794 stringify!(kernelExecTimeoutEnabled)
3795 )
3796 );
3797 assert_eq!(
3798 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).integrated as *const _ as usize },
3799 396usize,
3800 concat!(
3801 "Offset of field: ",
3802 stringify!(cudaDeviceProp),
3803 "::",
3804 stringify!(integrated)
3805 )
3806 );
3807 assert_eq!(
3808 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).canMapHostMemory as *const _ as usize },
3809 400usize,
3810 concat!(
3811 "Offset of field: ",
3812 stringify!(cudaDeviceProp),
3813 "::",
3814 stringify!(canMapHostMemory)
3815 )
3816 );
3817 assert_eq!(
3818 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).computeMode as *const _ as usize },
3819 404usize,
3820 concat!(
3821 "Offset of field: ",
3822 stringify!(cudaDeviceProp),
3823 "::",
3824 stringify!(computeMode)
3825 )
3826 );
3827 assert_eq!(
3828 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture1D as *const _ as usize },
3829 408usize,
3830 concat!(
3831 "Offset of field: ",
3832 stringify!(cudaDeviceProp),
3833 "::",
3834 stringify!(maxTexture1D)
3835 )
3836 );
3837 assert_eq!(
3838 unsafe {
3839 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture1DMipmap as *const _ as usize
3840 },
3841 412usize,
3842 concat!(
3843 "Offset of field: ",
3844 stringify!(cudaDeviceProp),
3845 "::",
3846 stringify!(maxTexture1DMipmap)
3847 )
3848 );
3849 assert_eq!(
3850 unsafe {
3851 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture1DLinear as *const _ as usize
3852 },
3853 416usize,
3854 concat!(
3855 "Offset of field: ",
3856 stringify!(cudaDeviceProp),
3857 "::",
3858 stringify!(maxTexture1DLinear)
3859 )
3860 );
3861 assert_eq!(
3862 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture2D as *const _ as usize },
3863 420usize,
3864 concat!(
3865 "Offset of field: ",
3866 stringify!(cudaDeviceProp),
3867 "::",
3868 stringify!(maxTexture2D)
3869 )
3870 );
3871 assert_eq!(
3872 unsafe {
3873 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture2DMipmap as *const _ as usize
3874 },
3875 428usize,
3876 concat!(
3877 "Offset of field: ",
3878 stringify!(cudaDeviceProp),
3879 "::",
3880 stringify!(maxTexture2DMipmap)
3881 )
3882 );
3883 assert_eq!(
3884 unsafe {
3885 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture2DLinear as *const _ as usize
3886 },
3887 436usize,
3888 concat!(
3889 "Offset of field: ",
3890 stringify!(cudaDeviceProp),
3891 "::",
3892 stringify!(maxTexture2DLinear)
3893 )
3894 );
3895 assert_eq!(
3896 unsafe {
3897 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture2DGather as *const _ as usize
3898 },
3899 448usize,
3900 concat!(
3901 "Offset of field: ",
3902 stringify!(cudaDeviceProp),
3903 "::",
3904 stringify!(maxTexture2DGather)
3905 )
3906 );
3907 assert_eq!(
3908 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture3D as *const _ as usize },
3909 456usize,
3910 concat!(
3911 "Offset of field: ",
3912 stringify!(cudaDeviceProp),
3913 "::",
3914 stringify!(maxTexture3D)
3915 )
3916 );
3917 assert_eq!(
3918 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture3DAlt as *const _ as usize },
3919 468usize,
3920 concat!(
3921 "Offset of field: ",
3922 stringify!(cudaDeviceProp),
3923 "::",
3924 stringify!(maxTexture3DAlt)
3925 )
3926 );
3927 assert_eq!(
3928 unsafe {
3929 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTextureCubemap as *const _ as usize
3930 },
3931 480usize,
3932 concat!(
3933 "Offset of field: ",
3934 stringify!(cudaDeviceProp),
3935 "::",
3936 stringify!(maxTextureCubemap)
3937 )
3938 );
3939 assert_eq!(
3940 unsafe {
3941 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture1DLayered as *const _ as usize
3942 },
3943 484usize,
3944 concat!(
3945 "Offset of field: ",
3946 stringify!(cudaDeviceProp),
3947 "::",
3948 stringify!(maxTexture1DLayered)
3949 )
3950 );
3951 assert_eq!(
3952 unsafe {
3953 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTexture2DLayered as *const _ as usize
3954 },
3955 492usize,
3956 concat!(
3957 "Offset of field: ",
3958 stringify!(cudaDeviceProp),
3959 "::",
3960 stringify!(maxTexture2DLayered)
3961 )
3962 );
3963 assert_eq!(
3964 unsafe {
3965 &(*(::std::ptr::null::<cudaDeviceProp>())).maxTextureCubemapLayered as *const _ as usize
3966 },
3967 504usize,
3968 concat!(
3969 "Offset of field: ",
3970 stringify!(cudaDeviceProp),
3971 "::",
3972 stringify!(maxTextureCubemapLayered)
3973 )
3974 );
3975 assert_eq!(
3976 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurface1D as *const _ as usize },
3977 512usize,
3978 concat!(
3979 "Offset of field: ",
3980 stringify!(cudaDeviceProp),
3981 "::",
3982 stringify!(maxSurface1D)
3983 )
3984 );
3985 assert_eq!(
3986 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurface2D as *const _ as usize },
3987 516usize,
3988 concat!(
3989 "Offset of field: ",
3990 stringify!(cudaDeviceProp),
3991 "::",
3992 stringify!(maxSurface2D)
3993 )
3994 );
3995 assert_eq!(
3996 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurface3D as *const _ as usize },
3997 524usize,
3998 concat!(
3999 "Offset of field: ",
4000 stringify!(cudaDeviceProp),
4001 "::",
4002 stringify!(maxSurface3D)
4003 )
4004 );
4005 assert_eq!(
4006 unsafe {
4007 &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurface1DLayered as *const _ as usize
4008 },
4009 536usize,
4010 concat!(
4011 "Offset of field: ",
4012 stringify!(cudaDeviceProp),
4013 "::",
4014 stringify!(maxSurface1DLayered)
4015 )
4016 );
4017 assert_eq!(
4018 unsafe {
4019 &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurface2DLayered as *const _ as usize
4020 },
4021 544usize,
4022 concat!(
4023 "Offset of field: ",
4024 stringify!(cudaDeviceProp),
4025 "::",
4026 stringify!(maxSurface2DLayered)
4027 )
4028 );
4029 assert_eq!(
4030 unsafe {
4031 &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurfaceCubemap as *const _ as usize
4032 },
4033 556usize,
4034 concat!(
4035 "Offset of field: ",
4036 stringify!(cudaDeviceProp),
4037 "::",
4038 stringify!(maxSurfaceCubemap)
4039 )
4040 );
4041 assert_eq!(
4042 unsafe {
4043 &(*(::std::ptr::null::<cudaDeviceProp>())).maxSurfaceCubemapLayered as *const _ as usize
4044 },
4045 560usize,
4046 concat!(
4047 "Offset of field: ",
4048 stringify!(cudaDeviceProp),
4049 "::",
4050 stringify!(maxSurfaceCubemapLayered)
4051 )
4052 );
4053 assert_eq!(
4054 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).surfaceAlignment as *const _ as usize },
4055 568usize,
4056 concat!(
4057 "Offset of field: ",
4058 stringify!(cudaDeviceProp),
4059 "::",
4060 stringify!(surfaceAlignment)
4061 )
4062 );
4063 assert_eq!(
4064 unsafe {
4065 &(*(::std::ptr::null::<cudaDeviceProp>())).concurrentKernels as *const _ as usize
4066 },
4067 576usize,
4068 concat!(
4069 "Offset of field: ",
4070 stringify!(cudaDeviceProp),
4071 "::",
4072 stringify!(concurrentKernels)
4073 )
4074 );
4075 assert_eq!(
4076 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).ECCEnabled as *const _ as usize },
4077 580usize,
4078 concat!(
4079 "Offset of field: ",
4080 stringify!(cudaDeviceProp),
4081 "::",
4082 stringify!(ECCEnabled)
4083 )
4084 );
4085 assert_eq!(
4086 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).pciBusID as *const _ as usize },
4087 584usize,
4088 concat!(
4089 "Offset of field: ",
4090 stringify!(cudaDeviceProp),
4091 "::",
4092 stringify!(pciBusID)
4093 )
4094 );
4095 assert_eq!(
4096 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).pciDeviceID as *const _ as usize },
4097 588usize,
4098 concat!(
4099 "Offset of field: ",
4100 stringify!(cudaDeviceProp),
4101 "::",
4102 stringify!(pciDeviceID)
4103 )
4104 );
4105 assert_eq!(
4106 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).pciDomainID as *const _ as usize },
4107 592usize,
4108 concat!(
4109 "Offset of field: ",
4110 stringify!(cudaDeviceProp),
4111 "::",
4112 stringify!(pciDomainID)
4113 )
4114 );
4115 assert_eq!(
4116 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).tccDriver as *const _ as usize },
4117 596usize,
4118 concat!(
4119 "Offset of field: ",
4120 stringify!(cudaDeviceProp),
4121 "::",
4122 stringify!(tccDriver)
4123 )
4124 );
4125 assert_eq!(
4126 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).asyncEngineCount as *const _ as usize },
4127 600usize,
4128 concat!(
4129 "Offset of field: ",
4130 stringify!(cudaDeviceProp),
4131 "::",
4132 stringify!(asyncEngineCount)
4133 )
4134 );
4135 assert_eq!(
4136 unsafe {
4137 &(*(::std::ptr::null::<cudaDeviceProp>())).unifiedAddressing as *const _ as usize
4138 },
4139 604usize,
4140 concat!(
4141 "Offset of field: ",
4142 stringify!(cudaDeviceProp),
4143 "::",
4144 stringify!(unifiedAddressing)
4145 )
4146 );
4147 assert_eq!(
4148 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).memoryClockRate as *const _ as usize },
4149 608usize,
4150 concat!(
4151 "Offset of field: ",
4152 stringify!(cudaDeviceProp),
4153 "::",
4154 stringify!(memoryClockRate)
4155 )
4156 );
4157 assert_eq!(
4158 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).memoryBusWidth as *const _ as usize },
4159 612usize,
4160 concat!(
4161 "Offset of field: ",
4162 stringify!(cudaDeviceProp),
4163 "::",
4164 stringify!(memoryBusWidth)
4165 )
4166 );
4167 assert_eq!(
4168 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).l2CacheSize as *const _ as usize },
4169 616usize,
4170 concat!(
4171 "Offset of field: ",
4172 stringify!(cudaDeviceProp),
4173 "::",
4174 stringify!(l2CacheSize)
4175 )
4176 );
4177 assert_eq!(
4178 unsafe {
4179 &(*(::std::ptr::null::<cudaDeviceProp>())).persistingL2CacheMaxSize as *const _ as usize
4180 },
4181 620usize,
4182 concat!(
4183 "Offset of field: ",
4184 stringify!(cudaDeviceProp),
4185 "::",
4186 stringify!(persistingL2CacheMaxSize)
4187 )
4188 );
4189 assert_eq!(
4190 unsafe {
4191 &(*(::std::ptr::null::<cudaDeviceProp>())).maxThreadsPerMultiProcessor as *const _
4192 as usize
4193 },
4194 624usize,
4195 concat!(
4196 "Offset of field: ",
4197 stringify!(cudaDeviceProp),
4198 "::",
4199 stringify!(maxThreadsPerMultiProcessor)
4200 )
4201 );
4202 assert_eq!(
4203 unsafe {
4204 &(*(::std::ptr::null::<cudaDeviceProp>())).streamPrioritiesSupported as *const _
4205 as usize
4206 },
4207 628usize,
4208 concat!(
4209 "Offset of field: ",
4210 stringify!(cudaDeviceProp),
4211 "::",
4212 stringify!(streamPrioritiesSupported)
4213 )
4214 );
4215 assert_eq!(
4216 unsafe {
4217 &(*(::std::ptr::null::<cudaDeviceProp>())).globalL1CacheSupported as *const _ as usize
4218 },
4219 632usize,
4220 concat!(
4221 "Offset of field: ",
4222 stringify!(cudaDeviceProp),
4223 "::",
4224 stringify!(globalL1CacheSupported)
4225 )
4226 );
4227 assert_eq!(
4228 unsafe {
4229 &(*(::std::ptr::null::<cudaDeviceProp>())).localL1CacheSupported as *const _ as usize
4230 },
4231 636usize,
4232 concat!(
4233 "Offset of field: ",
4234 stringify!(cudaDeviceProp),
4235 "::",
4236 stringify!(localL1CacheSupported)
4237 )
4238 );
4239 assert_eq!(
4240 unsafe {
4241 &(*(::std::ptr::null::<cudaDeviceProp>())).sharedMemPerMultiprocessor as *const _
4242 as usize
4243 },
4244 640usize,
4245 concat!(
4246 "Offset of field: ",
4247 stringify!(cudaDeviceProp),
4248 "::",
4249 stringify!(sharedMemPerMultiprocessor)
4250 )
4251 );
4252 assert_eq!(
4253 unsafe {
4254 &(*(::std::ptr::null::<cudaDeviceProp>())).regsPerMultiprocessor as *const _ as usize
4255 },
4256 648usize,
4257 concat!(
4258 "Offset of field: ",
4259 stringify!(cudaDeviceProp),
4260 "::",
4261 stringify!(regsPerMultiprocessor)
4262 )
4263 );
4264 assert_eq!(
4265 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).managedMemory as *const _ as usize },
4266 652usize,
4267 concat!(
4268 "Offset of field: ",
4269 stringify!(cudaDeviceProp),
4270 "::",
4271 stringify!(managedMemory)
4272 )
4273 );
4274 assert_eq!(
4275 unsafe { &(*(::std::ptr::null::<cudaDeviceProp>())).isMultiGpuBoard as *const _ as usize },
4276 656usize,
4277 concat!(
4278 "Offset of field: ",
4279 stringify!(cudaDeviceProp),
4280 "::",
4281 stringify!(isMultiGpuBoard)
4282 )
4283 );
4284 assert_eq!(
4285 unsafe {
4286 &(*(::std::ptr::null::<cudaDeviceProp>())).multiGpuBoardGroupID as *const _ as usize
4287 },
4288 660usize,
4289 concat!(
4290 "Offset of field: ",
4291 stringify!(cudaDeviceProp),
4292 "::",
4293 stringify!(multiGpuBoardGroupID)
4294 )
4295 );
4296 assert_eq!(
4297 unsafe {
4298 &(*(::std::ptr::null::<cudaDeviceProp>())).hostNativeAtomicSupported as *const _
4299 as usize
4300 },
4301 664usize,
4302 concat!(
4303 "Offset of field: ",
4304 stringify!(cudaDeviceProp),
4305 "::",
4306 stringify!(hostNativeAtomicSupported)
4307 )
4308 );
4309 assert_eq!(
4310 unsafe {
4311 &(*(::std::ptr::null::<cudaDeviceProp>())).singleToDoublePrecisionPerfRatio as *const _
4312 as usize
4313 },
4314 668usize,
4315 concat!(
4316 "Offset of field: ",
4317 stringify!(cudaDeviceProp),
4318 "::",
4319 stringify!(singleToDoublePrecisionPerfRatio)
4320 )
4321 );
4322 assert_eq!(
4323 unsafe {
4324 &(*(::std::ptr::null::<cudaDeviceProp>())).pageableMemoryAccess as *const _ as usize
4325 },
4326 672usize,
4327 concat!(
4328 "Offset of field: ",
4329 stringify!(cudaDeviceProp),
4330 "::",
4331 stringify!(pageableMemoryAccess)
4332 )
4333 );
4334 assert_eq!(
4335 unsafe {
4336 &(*(::std::ptr::null::<cudaDeviceProp>())).concurrentManagedAccess as *const _ as usize
4337 },
4338 676usize,
4339 concat!(
4340 "Offset of field: ",
4341 stringify!(cudaDeviceProp),
4342 "::",
4343 stringify!(concurrentManagedAccess)
4344 )
4345 );
4346 assert_eq!(
4347 unsafe {
4348 &(*(::std::ptr::null::<cudaDeviceProp>())).computePreemptionSupported as *const _
4349 as usize
4350 },
4351 680usize,
4352 concat!(
4353 "Offset of field: ",
4354 stringify!(cudaDeviceProp),
4355 "::",
4356 stringify!(computePreemptionSupported)
4357 )
4358 );
4359 assert_eq!(
4360 unsafe {
4361 &(*(::std::ptr::null::<cudaDeviceProp>())).canUseHostPointerForRegisteredMem as *const _
4362 as usize
4363 },
4364 684usize,
4365 concat!(
4366 "Offset of field: ",
4367 stringify!(cudaDeviceProp),
4368 "::",
4369 stringify!(canUseHostPointerForRegisteredMem)
4370 )
4371 );
4372 assert_eq!(
4373 unsafe {
4374 &(*(::std::ptr::null::<cudaDeviceProp>())).cooperativeLaunch as *const _ as usize
4375 },
4376 688usize,
4377 concat!(
4378 "Offset of field: ",
4379 stringify!(cudaDeviceProp),
4380 "::",
4381 stringify!(cooperativeLaunch)
4382 )
4383 );
4384 assert_eq!(
4385 unsafe {
4386 &(*(::std::ptr::null::<cudaDeviceProp>())).cooperativeMultiDeviceLaunch as *const _
4387 as usize
4388 },
4389 692usize,
4390 concat!(
4391 "Offset of field: ",
4392 stringify!(cudaDeviceProp),
4393 "::",
4394 stringify!(cooperativeMultiDeviceLaunch)
4395 )
4396 );
4397 assert_eq!(
4398 unsafe {
4399 &(*(::std::ptr::null::<cudaDeviceProp>())).sharedMemPerBlockOptin as *const _ as usize
4400 },
4401 696usize,
4402 concat!(
4403 "Offset of field: ",
4404 stringify!(cudaDeviceProp),
4405 "::",
4406 stringify!(sharedMemPerBlockOptin)
4407 )
4408 );
4409 assert_eq!(
4410 unsafe {
4411 &(*(::std::ptr::null::<cudaDeviceProp>())).pageableMemoryAccessUsesHostPageTables
4412 as *const _ as usize
4413 },
4414 704usize,
4415 concat!(
4416 "Offset of field: ",
4417 stringify!(cudaDeviceProp),
4418 "::",
4419 stringify!(pageableMemoryAccessUsesHostPageTables)
4420 )
4421 );
4422 assert_eq!(
4423 unsafe {
4424 &(*(::std::ptr::null::<cudaDeviceProp>())).directManagedMemAccessFromHost as *const _
4425 as usize
4426 },
4427 708usize,
4428 concat!(
4429 "Offset of field: ",
4430 stringify!(cudaDeviceProp),
4431 "::",
4432 stringify!(directManagedMemAccessFromHost)
4433 )
4434 );
4435 assert_eq!(
4436 unsafe {
4437 &(*(::std::ptr::null::<cudaDeviceProp>())).maxBlocksPerMultiProcessor as *const _
4438 as usize
4439 },
4440 712usize,
4441 concat!(
4442 "Offset of field: ",
4443 stringify!(cudaDeviceProp),
4444 "::",
4445 stringify!(maxBlocksPerMultiProcessor)
4446 )
4447 );
4448 assert_eq!(
4449 unsafe {
4450 &(*(::std::ptr::null::<cudaDeviceProp>())).accessPolicyMaxWindowSize as *const _
4451 as usize
4452 },
4453 716usize,
4454 concat!(
4455 "Offset of field: ",
4456 stringify!(cudaDeviceProp),
4457 "::",
4458 stringify!(accessPolicyMaxWindowSize)
4459 )
4460 );
4461 assert_eq!(
4462 unsafe {
4463 &(*(::std::ptr::null::<cudaDeviceProp>())).reservedSharedMemPerBlock as *const _
4464 as usize
4465 },
4466 720usize,
4467 concat!(
4468 "Offset of field: ",
4469 stringify!(cudaDeviceProp),
4470 "::",
4471 stringify!(reservedSharedMemPerBlock)
4472 )
4473 );
4474}
4475#[doc = " CUDA IPC event handle"]
4476#[repr(C)]
4477#[derive(Copy, Clone)]
4478pub struct cudaIpcEventHandle_st {
4479 pub reserved: [::libc::c_char; 64usize],
4480}
4481#[test]
4482fn bindgen_test_layout_cudaIpcEventHandle_st() {
4483 assert_eq!(
4484 ::std::mem::size_of::<cudaIpcEventHandle_st>(),
4485 64usize,
4486 concat!("Size of: ", stringify!(cudaIpcEventHandle_st))
4487 );
4488 assert_eq!(
4489 ::std::mem::align_of::<cudaIpcEventHandle_st>(),
4490 1usize,
4491 concat!("Alignment of ", stringify!(cudaIpcEventHandle_st))
4492 );
4493 assert_eq!(
4494 unsafe { &(*(::std::ptr::null::<cudaIpcEventHandle_st>())).reserved as *const _ as usize },
4495 0usize,
4496 concat!(
4497 "Offset of field: ",
4498 stringify!(cudaIpcEventHandle_st),
4499 "::",
4500 stringify!(reserved)
4501 )
4502 );
4503}
4504#[doc = " CUDA IPC event handle"]
4505pub type cudaIpcEventHandle_t = cudaIpcEventHandle_st;
4506#[doc = " CUDA IPC memory handle"]
4507#[repr(C)]
4508#[derive(Copy, Clone)]
4509pub struct cudaIpcMemHandle_st {
4510 pub reserved: [::libc::c_char; 64usize],
4511}
4512#[test]
4513fn bindgen_test_layout_cudaIpcMemHandle_st() {
4514 assert_eq!(
4515 ::std::mem::size_of::<cudaIpcMemHandle_st>(),
4516 64usize,
4517 concat!("Size of: ", stringify!(cudaIpcMemHandle_st))
4518 );
4519 assert_eq!(
4520 ::std::mem::align_of::<cudaIpcMemHandle_st>(),
4521 1usize,
4522 concat!("Alignment of ", stringify!(cudaIpcMemHandle_st))
4523 );
4524 assert_eq!(
4525 unsafe { &(*(::std::ptr::null::<cudaIpcMemHandle_st>())).reserved as *const _ as usize },
4526 0usize,
4527 concat!(
4528 "Offset of field: ",
4529 stringify!(cudaIpcMemHandle_st),
4530 "::",
4531 stringify!(reserved)
4532 )
4533 );
4534}
4535#[doc = " CUDA IPC memory handle"]
4536pub type cudaIpcMemHandle_t = cudaIpcMemHandle_st;
4537#[repr(u32)]
4538#[non_exhaustive]
4539#[doc = " External memory handle types"]
4540#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4541pub enum cudaExternalMemoryHandleType {
4542 #[doc = " Handle is an opaque file descriptor"]
4543 cudaExternalMemoryHandleTypeOpaqueFd = 1,
4544 #[doc = " Handle is an opaque shared NT handle"]
4545 cudaExternalMemoryHandleTypeOpaqueWin32 = 2,
4546 #[doc = " Handle is an opaque, globally shared handle"]
4547 cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3,
4548 #[doc = " Handle is a D3D12 heap object"]
4549 cudaExternalMemoryHandleTypeD3D12Heap = 4,
4550 #[doc = " Handle is a D3D12 committed resource"]
4551 cudaExternalMemoryHandleTypeD3D12Resource = 5,
4552 #[doc = " Handle is a shared NT handle to a D3D11 resource"]
4553 cudaExternalMemoryHandleTypeD3D11Resource = 6,
4554 #[doc = " Handle is a globally shared handle to a D3D11 resource"]
4555 cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7,
4556 #[doc = " Handle is an NvSciBuf object"]
4557 cudaExternalMemoryHandleTypeNvSciBuf = 8,
4558}
4559#[doc = " External memory handle descriptor"]
4560#[repr(C)]
4561#[derive(Copy, Clone)]
4562pub struct cudaExternalMemoryHandleDesc {
4563 #[doc = " Type of the handle"]
4564 pub type_: cudaExternalMemoryHandleType,
4565 pub handle: cudaExternalMemoryHandleDesc__bindgen_ty_1,
4566 #[doc = " Size of the memory allocation"]
4567 pub size: ::libc::c_ulonglong,
4568 #[doc = " Flags must either be zero or ::cudaExternalMemoryDedicated"]
4569 pub flags: ::libc::c_uint,
4570}
4571#[repr(C)]
4572#[derive(Copy, Clone)]
4573pub union cudaExternalMemoryHandleDesc__bindgen_ty_1 {
4574 #[doc = " File descriptor referencing the memory object. Valid"]
4575 #[doc = " when type is"]
4576 #[doc = " ::cudaExternalMemoryHandleTypeOpaqueFd"]
4577 pub fd: ::libc::c_int,
4578 pub win32: cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1,
4579 #[doc = " A handle representing NvSciBuf Object. Valid when type"]
4580 #[doc = " is ::cudaExternalMemoryHandleTypeNvSciBuf"]
4581 pub nvSciBufObject: *const ::libc::c_void,
4582}
4583#[doc = " Win32 handle referencing the semaphore object. Valid when"]
4584#[doc = " type is one of the following:"]
4585#[doc = " - ::cudaExternalMemoryHandleTypeOpaqueWin32"]
4586#[doc = " - ::cudaExternalMemoryHandleTypeOpaqueWin32Kmt"]
4587#[doc = " - ::cudaExternalMemoryHandleTypeD3D12Heap"]
4588#[doc = " - ::cudaExternalMemoryHandleTypeD3D12Resource"]
4589#[doc = " - ::cudaExternalMemoryHandleTypeD3D11Resource"]
4590#[doc = " - ::cudaExternalMemoryHandleTypeD3D11ResourceKmt"]
4591#[doc = " Exactly one of 'handle' and 'name' must be non-NULL. If"]
4592#[doc = " type is one of the following:"]
4593#[doc = " ::cudaExternalMemoryHandleTypeOpaqueWin32Kmt"]
4594#[doc = " ::cudaExternalMemoryHandleTypeD3D11ResourceKmt"]
4595#[doc = " then 'name' must be NULL."]
4596#[repr(C)]
4597#[derive(Debug, Copy, Clone)]
4598pub struct cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1 {
4599 #[doc = " Valid NT handle. Must be NULL if 'name' is non-NULL"]
4600 pub handle: *mut ::libc::c_void,
4601 #[doc = " Name of a valid memory object."]
4602 #[doc = " Must be NULL if 'handle' is non-NULL."]
4603 pub name: *const ::libc::c_void,
4604}
4605#[test]
4606fn bindgen_test_layout_cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1() {
4607 assert_eq!(
4608 ::std::mem::size_of::<cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1>(),
4609 16usize,
4610 concat!(
4611 "Size of: ",
4612 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1)
4613 )
4614 );
4615 assert_eq!(
4616 ::std::mem::align_of::<cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1>(),
4617 8usize,
4618 concat!(
4619 "Alignment of ",
4620 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1)
4621 )
4622 );
4623 assert_eq!(
4624 unsafe {
4625 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1>()))
4626 .handle as *const _ as usize
4627 },
4628 0usize,
4629 concat!(
4630 "Offset of field: ",
4631 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1),
4632 "::",
4633 stringify!(handle)
4634 )
4635 );
4636 assert_eq!(
4637 unsafe {
4638 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1>()))
4639 .name as *const _ as usize
4640 },
4641 8usize,
4642 concat!(
4643 "Offset of field: ",
4644 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1__bindgen_ty_1),
4645 "::",
4646 stringify!(name)
4647 )
4648 );
4649}
4650#[test]
4651fn bindgen_test_layout_cudaExternalMemoryHandleDesc__bindgen_ty_1() {
4652 assert_eq!(
4653 ::std::mem::size_of::<cudaExternalMemoryHandleDesc__bindgen_ty_1>(),
4654 16usize,
4655 concat!(
4656 "Size of: ",
4657 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1)
4658 )
4659 );
4660 assert_eq!(
4661 ::std::mem::align_of::<cudaExternalMemoryHandleDesc__bindgen_ty_1>(),
4662 8usize,
4663 concat!(
4664 "Alignment of ",
4665 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1)
4666 )
4667 );
4668 assert_eq!(
4669 unsafe {
4670 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc__bindgen_ty_1>())).fd as *const _
4671 as usize
4672 },
4673 0usize,
4674 concat!(
4675 "Offset of field: ",
4676 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1),
4677 "::",
4678 stringify!(fd)
4679 )
4680 );
4681 assert_eq!(
4682 unsafe {
4683 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc__bindgen_ty_1>())).win32 as *const _
4684 as usize
4685 },
4686 0usize,
4687 concat!(
4688 "Offset of field: ",
4689 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1),
4690 "::",
4691 stringify!(win32)
4692 )
4693 );
4694 assert_eq!(
4695 unsafe {
4696 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc__bindgen_ty_1>())).nvSciBufObject
4697 as *const _ as usize
4698 },
4699 0usize,
4700 concat!(
4701 "Offset of field: ",
4702 stringify!(cudaExternalMemoryHandleDesc__bindgen_ty_1),
4703 "::",
4704 stringify!(nvSciBufObject)
4705 )
4706 );
4707}
4708#[test]
4709fn bindgen_test_layout_cudaExternalMemoryHandleDesc() {
4710 assert_eq!(
4711 ::std::mem::size_of::<cudaExternalMemoryHandleDesc>(),
4712 40usize,
4713 concat!("Size of: ", stringify!(cudaExternalMemoryHandleDesc))
4714 );
4715 assert_eq!(
4716 ::std::mem::align_of::<cudaExternalMemoryHandleDesc>(),
4717 8usize,
4718 concat!("Alignment of ", stringify!(cudaExternalMemoryHandleDesc))
4719 );
4720 assert_eq!(
4721 unsafe {
4722 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc>())).type_ as *const _ as usize
4723 },
4724 0usize,
4725 concat!(
4726 "Offset of field: ",
4727 stringify!(cudaExternalMemoryHandleDesc),
4728 "::",
4729 stringify!(type_)
4730 )
4731 );
4732 assert_eq!(
4733 unsafe {
4734 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc>())).handle as *const _ as usize
4735 },
4736 8usize,
4737 concat!(
4738 "Offset of field: ",
4739 stringify!(cudaExternalMemoryHandleDesc),
4740 "::",
4741 stringify!(handle)
4742 )
4743 );
4744 assert_eq!(
4745 unsafe {
4746 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc>())).size as *const _ as usize
4747 },
4748 24usize,
4749 concat!(
4750 "Offset of field: ",
4751 stringify!(cudaExternalMemoryHandleDesc),
4752 "::",
4753 stringify!(size)
4754 )
4755 );
4756 assert_eq!(
4757 unsafe {
4758 &(*(::std::ptr::null::<cudaExternalMemoryHandleDesc>())).flags as *const _ as usize
4759 },
4760 32usize,
4761 concat!(
4762 "Offset of field: ",
4763 stringify!(cudaExternalMemoryHandleDesc),
4764 "::",
4765 stringify!(flags)
4766 )
4767 );
4768}
4769#[doc = " External memory buffer descriptor"]
4770#[repr(C)]
4771#[derive(Debug, Copy, Clone)]
4772pub struct cudaExternalMemoryBufferDesc {
4773 #[doc = " Offset into the memory object where the buffer's base is"]
4774 pub offset: ::libc::c_ulonglong,
4775 #[doc = " Size of the buffer"]
4776 pub size: ::libc::c_ulonglong,
4777 #[doc = " Flags reserved for future use. Must be zero."]
4778 pub flags: ::libc::c_uint,
4779}
4780#[test]
4781fn bindgen_test_layout_cudaExternalMemoryBufferDesc() {
4782 assert_eq!(
4783 ::std::mem::size_of::<cudaExternalMemoryBufferDesc>(),
4784 24usize,
4785 concat!("Size of: ", stringify!(cudaExternalMemoryBufferDesc))
4786 );
4787 assert_eq!(
4788 ::std::mem::align_of::<cudaExternalMemoryBufferDesc>(),
4789 8usize,
4790 concat!("Alignment of ", stringify!(cudaExternalMemoryBufferDesc))
4791 );
4792 assert_eq!(
4793 unsafe {
4794 &(*(::std::ptr::null::<cudaExternalMemoryBufferDesc>())).offset as *const _ as usize
4795 },
4796 0usize,
4797 concat!(
4798 "Offset of field: ",
4799 stringify!(cudaExternalMemoryBufferDesc),
4800 "::",
4801 stringify!(offset)
4802 )
4803 );
4804 assert_eq!(
4805 unsafe {
4806 &(*(::std::ptr::null::<cudaExternalMemoryBufferDesc>())).size as *const _ as usize
4807 },
4808 8usize,
4809 concat!(
4810 "Offset of field: ",
4811 stringify!(cudaExternalMemoryBufferDesc),
4812 "::",
4813 stringify!(size)
4814 )
4815 );
4816 assert_eq!(
4817 unsafe {
4818 &(*(::std::ptr::null::<cudaExternalMemoryBufferDesc>())).flags as *const _ as usize
4819 },
4820 16usize,
4821 concat!(
4822 "Offset of field: ",
4823 stringify!(cudaExternalMemoryBufferDesc),
4824 "::",
4825 stringify!(flags)
4826 )
4827 );
4828}
4829#[doc = " External memory mipmap descriptor"]
4830#[repr(C)]
4831#[derive(Debug, Copy, Clone)]
4832pub struct cudaExternalMemoryMipmappedArrayDesc {
4833 #[doc = " Offset into the memory object where the base level of the"]
4834 #[doc = " mipmap chain is."]
4835 pub offset: ::libc::c_ulonglong,
4836 #[doc = " Format of base level of the mipmap chain"]
4837 pub formatDesc: cudaChannelFormatDesc,
4838 #[doc = " Dimensions of base level of the mipmap chain"]
4839 pub extent: cudaExtent,
4840 #[doc = " Flags associated with CUDA mipmapped arrays."]
4841 #[doc = " See ::cudaMallocMipmappedArray"]
4842 pub flags: ::libc::c_uint,
4843 #[doc = " Total number of levels in the mipmap chain"]
4844 pub numLevels: ::libc::c_uint,
4845}
4846#[test]
4847fn bindgen_test_layout_cudaExternalMemoryMipmappedArrayDesc() {
4848 assert_eq!(
4849 ::std::mem::size_of::<cudaExternalMemoryMipmappedArrayDesc>(),
4850 64usize,
4851 concat!(
4852 "Size of: ",
4853 stringify!(cudaExternalMemoryMipmappedArrayDesc)
4854 )
4855 );
4856 assert_eq!(
4857 ::std::mem::align_of::<cudaExternalMemoryMipmappedArrayDesc>(),
4858 8usize,
4859 concat!(
4860 "Alignment of ",
4861 stringify!(cudaExternalMemoryMipmappedArrayDesc)
4862 )
4863 );
4864 assert_eq!(
4865 unsafe {
4866 &(*(::std::ptr::null::<cudaExternalMemoryMipmappedArrayDesc>())).offset as *const _
4867 as usize
4868 },
4869 0usize,
4870 concat!(
4871 "Offset of field: ",
4872 stringify!(cudaExternalMemoryMipmappedArrayDesc),
4873 "::",
4874 stringify!(offset)
4875 )
4876 );
4877 assert_eq!(
4878 unsafe {
4879 &(*(::std::ptr::null::<cudaExternalMemoryMipmappedArrayDesc>())).formatDesc as *const _
4880 as usize
4881 },
4882 8usize,
4883 concat!(
4884 "Offset of field: ",
4885 stringify!(cudaExternalMemoryMipmappedArrayDesc),
4886 "::",
4887 stringify!(formatDesc)
4888 )
4889 );
4890 assert_eq!(
4891 unsafe {
4892 &(*(::std::ptr::null::<cudaExternalMemoryMipmappedArrayDesc>())).extent as *const _
4893 as usize
4894 },
4895 32usize,
4896 concat!(
4897 "Offset of field: ",
4898 stringify!(cudaExternalMemoryMipmappedArrayDesc),
4899 "::",
4900 stringify!(extent)
4901 )
4902 );
4903 assert_eq!(
4904 unsafe {
4905 &(*(::std::ptr::null::<cudaExternalMemoryMipmappedArrayDesc>())).flags as *const _
4906 as usize
4907 },
4908 56usize,
4909 concat!(
4910 "Offset of field: ",
4911 stringify!(cudaExternalMemoryMipmappedArrayDesc),
4912 "::",
4913 stringify!(flags)
4914 )
4915 );
4916 assert_eq!(
4917 unsafe {
4918 &(*(::std::ptr::null::<cudaExternalMemoryMipmappedArrayDesc>())).numLevels as *const _
4919 as usize
4920 },
4921 60usize,
4922 concat!(
4923 "Offset of field: ",
4924 stringify!(cudaExternalMemoryMipmappedArrayDesc),
4925 "::",
4926 stringify!(numLevels)
4927 )
4928 );
4929}
4930#[repr(u32)]
4931#[non_exhaustive]
4932#[doc = " External semaphore handle types"]
4933#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4934pub enum cudaExternalSemaphoreHandleType {
4935 #[doc = " Handle is an opaque file descriptor"]
4936 cudaExternalSemaphoreHandleTypeOpaqueFd = 1,
4937 #[doc = " Handle is an opaque shared NT handle"]
4938 cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2,
4939 #[doc = " Handle is an opaque, globally shared handle"]
4940 cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3,
4941 #[doc = " Handle is a shared NT handle referencing a D3D12 fence object"]
4942 cudaExternalSemaphoreHandleTypeD3D12Fence = 4,
4943 #[doc = " Handle is a shared NT handle referencing a D3D11 fence object"]
4944 cudaExternalSemaphoreHandleTypeD3D11Fence = 5,
4945 #[doc = " Opaque handle to NvSciSync Object"]
4946 cudaExternalSemaphoreHandleTypeNvSciSync = 6,
4947 #[doc = " Handle is a shared NT handle referencing a D3D11 keyed mutex object"]
4948 cudaExternalSemaphoreHandleTypeKeyedMutex = 7,
4949 #[doc = " Handle is a shared KMT handle referencing a D3D11 keyed mutex object"]
4950 cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8,
4951 #[doc = " Handle is an opaque handle file descriptor referencing a timeline semaphore"]
4952 cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9,
4953 #[doc = " Handle is an opaque handle file descriptor referencing a timeline semaphore"]
4954 cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10,
4955}
4956#[doc = " External semaphore handle descriptor"]
4957#[repr(C)]
4958#[derive(Copy, Clone)]
4959pub struct cudaExternalSemaphoreHandleDesc {
4960 #[doc = " Type of the handle"]
4961 pub type_: cudaExternalSemaphoreHandleType,
4962 pub handle: cudaExternalSemaphoreHandleDesc__bindgen_ty_1,
4963 #[doc = " Flags reserved for the future. Must be zero."]
4964 pub flags: ::libc::c_uint,
4965}
4966#[repr(C)]
4967#[derive(Copy, Clone)]
4968pub union cudaExternalSemaphoreHandleDesc__bindgen_ty_1 {
4969 #[doc = " File descriptor referencing the semaphore object. Valid when"]
4970 #[doc = " type is one of the following:"]
4971 #[doc = " - ::cudaExternalSemaphoreHandleTypeOpaqueFd"]
4972 #[doc = " - ::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd"]
4973 pub fd: ::libc::c_int,
4974 pub win32: cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1,
4975 #[doc = " Valid NvSciSyncObj. Must be non NULL"]
4976 pub nvSciSyncObj: *const ::libc::c_void,
4977}
4978#[doc = " Win32 handle referencing the semaphore object. Valid when"]
4979#[doc = " type is one of the following:"]
4980#[doc = " - ::cudaExternalSemaphoreHandleTypeOpaqueWin32"]
4981#[doc = " - ::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt"]
4982#[doc = " - ::cudaExternalSemaphoreHandleTypeD3D12Fence"]
4983#[doc = " - ::cudaExternalSemaphoreHandleTypeD3D11Fence"]
4984#[doc = " - ::cudaExternalSemaphoreHandleTypeKeyedMutex"]
4985#[doc = " - ::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32"]
4986#[doc = " Exactly one of 'handle' and 'name' must be non-NULL. If"]
4987#[doc = " type is one of the following:"]
4988#[doc = " ::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt"]
4989#[doc = " ::cudaExternalSemaphoreHandleTypeKeyedMutexKmt"]
4990#[doc = " then 'name' must be NULL."]
4991#[repr(C)]
4992#[derive(Debug, Copy, Clone)]
4993pub struct cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1 {
4994 #[doc = " Valid NT handle. Must be NULL if 'name' is non-NULL"]
4995 pub handle: *mut ::libc::c_void,
4996 #[doc = " Name of a valid synchronization primitive."]
4997 #[doc = " Must be NULL if 'handle' is non-NULL."]
4998 pub name: *const ::libc::c_void,
4999}
5000#[test]
5001fn bindgen_test_layout_cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1() {
5002 assert_eq!(
5003 ::std::mem::size_of::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1>(),
5004 16usize,
5005 concat!(
5006 "Size of: ",
5007 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1)
5008 )
5009 );
5010 assert_eq!(
5011 ::std::mem::align_of::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1>(),
5012 8usize,
5013 concat!(
5014 "Alignment of ",
5015 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1)
5016 )
5017 );
5018 assert_eq!(
5019 unsafe {
5020 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1>()))
5021 .handle as *const _ as usize
5022 },
5023 0usize,
5024 concat!(
5025 "Offset of field: ",
5026 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1),
5027 "::",
5028 stringify!(handle)
5029 )
5030 );
5031 assert_eq!(
5032 unsafe {
5033 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1>()))
5034 .name as *const _ as usize
5035 },
5036 8usize,
5037 concat!(
5038 "Offset of field: ",
5039 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1__bindgen_ty_1),
5040 "::",
5041 stringify!(name)
5042 )
5043 );
5044}
5045#[test]
5046fn bindgen_test_layout_cudaExternalSemaphoreHandleDesc__bindgen_ty_1() {
5047 assert_eq!(
5048 ::std::mem::size_of::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1>(),
5049 16usize,
5050 concat!(
5051 "Size of: ",
5052 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1)
5053 )
5054 );
5055 assert_eq!(
5056 ::std::mem::align_of::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1>(),
5057 8usize,
5058 concat!(
5059 "Alignment of ",
5060 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1)
5061 )
5062 );
5063 assert_eq!(
5064 unsafe {
5065 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1>())).fd as *const _
5066 as usize
5067 },
5068 0usize,
5069 concat!(
5070 "Offset of field: ",
5071 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1),
5072 "::",
5073 stringify!(fd)
5074 )
5075 );
5076 assert_eq!(
5077 unsafe {
5078 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1>())).win32
5079 as *const _ as usize
5080 },
5081 0usize,
5082 concat!(
5083 "Offset of field: ",
5084 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1),
5085 "::",
5086 stringify!(win32)
5087 )
5088 );
5089 assert_eq!(
5090 unsafe {
5091 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc__bindgen_ty_1>())).nvSciSyncObj
5092 as *const _ as usize
5093 },
5094 0usize,
5095 concat!(
5096 "Offset of field: ",
5097 stringify!(cudaExternalSemaphoreHandleDesc__bindgen_ty_1),
5098 "::",
5099 stringify!(nvSciSyncObj)
5100 )
5101 );
5102}
5103#[test]
5104fn bindgen_test_layout_cudaExternalSemaphoreHandleDesc() {
5105 assert_eq!(
5106 ::std::mem::size_of::<cudaExternalSemaphoreHandleDesc>(),
5107 32usize,
5108 concat!("Size of: ", stringify!(cudaExternalSemaphoreHandleDesc))
5109 );
5110 assert_eq!(
5111 ::std::mem::align_of::<cudaExternalSemaphoreHandleDesc>(),
5112 8usize,
5113 concat!("Alignment of ", stringify!(cudaExternalSemaphoreHandleDesc))
5114 );
5115 assert_eq!(
5116 unsafe {
5117 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc>())).type_ as *const _ as usize
5118 },
5119 0usize,
5120 concat!(
5121 "Offset of field: ",
5122 stringify!(cudaExternalSemaphoreHandleDesc),
5123 "::",
5124 stringify!(type_)
5125 )
5126 );
5127 assert_eq!(
5128 unsafe {
5129 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc>())).handle as *const _ as usize
5130 },
5131 8usize,
5132 concat!(
5133 "Offset of field: ",
5134 stringify!(cudaExternalSemaphoreHandleDesc),
5135 "::",
5136 stringify!(handle)
5137 )
5138 );
5139 assert_eq!(
5140 unsafe {
5141 &(*(::std::ptr::null::<cudaExternalSemaphoreHandleDesc>())).flags as *const _ as usize
5142 },
5143 24usize,
5144 concat!(
5145 "Offset of field: ",
5146 stringify!(cudaExternalSemaphoreHandleDesc),
5147 "::",
5148 stringify!(flags)
5149 )
5150 );
5151}
5152#[doc = " External semaphore signal parameters, compatible with driver type"]
5153#[repr(C)]
5154#[derive(Copy, Clone)]
5155pub struct cudaExternalSemaphoreSignalParams {
5156 pub params: cudaExternalSemaphoreSignalParams__bindgen_ty_1,
5157 #[doc = " Only when ::cudaExternalSemaphoreSignalParams is used to"]
5158 #[doc = " signal a ::cudaExternalSemaphore_t of type"]
5159 #[doc = " ::cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is"]
5160 #[doc = " ::cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates"]
5161 #[doc = " that while signaling the ::cudaExternalSemaphore_t, no memory"]
5162 #[doc = " synchronization operations should be performed for any external memory"]
5163 #[doc = " object imported as ::cudaExternalMemoryHandleTypeNvSciBuf."]
5164 #[doc = " For all other types of ::cudaExternalSemaphore_t, flags must be zero."]
5165 pub flags: ::libc::c_uint,
5166 pub reserved: [::libc::c_uint; 16usize],
5167}
5168#[repr(C)]
5169#[derive(Copy, Clone)]
5170pub struct cudaExternalSemaphoreSignalParams__bindgen_ty_1 {
5171 pub fence: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1,
5172 pub nvSciSync: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2,
5173 pub keyedMutex: cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3,
5174 pub reserved: [::libc::c_uint; 12usize],
5175}
5176#[doc = " Parameters for fence objects"]
5177#[repr(C)]
5178#[derive(Debug, Copy, Clone)]
5179pub struct cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1 {
5180 #[doc = " Value of fence to be signaled"]
5181 pub value: ::libc::c_ulonglong,
5182}
5183#[test]
5184fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1() {
5185 assert_eq!(
5186 ::std::mem::size_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1>(),
5187 8usize,
5188 concat!(
5189 "Size of: ",
5190 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1)
5191 )
5192 );
5193 assert_eq!(
5194 ::std::mem::align_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1>(),
5195 8usize,
5196 concat!(
5197 "Alignment of ",
5198 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1)
5199 )
5200 );
5201 assert_eq!(
5202 unsafe {
5203 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1>(
5204 )))
5205 .value as *const _ as usize
5206 },
5207 0usize,
5208 concat!(
5209 "Offset of field: ",
5210 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_1),
5211 "::",
5212 stringify!(value)
5213 )
5214 );
5215}
5216#[repr(C)]
5217#[derive(Copy, Clone)]
5218pub union cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2 {
5219 #[doc = " Pointer to NvSciSyncFence. Valid if ::cudaExternalSemaphoreHandleType"]
5220 #[doc = " is of type ::cudaExternalSemaphoreHandleTypeNvSciSync."]
5221 pub fence: *mut ::libc::c_void,
5222 pub reserved: ::libc::c_ulonglong,
5223}
5224#[test]
5225fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2() {
5226 assert_eq!(
5227 ::std::mem::size_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2>(),
5228 8usize,
5229 concat!(
5230 "Size of: ",
5231 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2)
5232 )
5233 );
5234 assert_eq!(
5235 ::std::mem::align_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2>(),
5236 8usize,
5237 concat!(
5238 "Alignment of ",
5239 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2)
5240 )
5241 );
5242 assert_eq!(
5243 unsafe {
5244 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2>(
5245 )))
5246 .fence as *const _ as usize
5247 },
5248 0usize,
5249 concat!(
5250 "Offset of field: ",
5251 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2),
5252 "::",
5253 stringify!(fence)
5254 )
5255 );
5256 assert_eq!(
5257 unsafe {
5258 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2>(
5259 )))
5260 .reserved as *const _ as usize
5261 },
5262 0usize,
5263 concat!(
5264 "Offset of field: ",
5265 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_2),
5266 "::",
5267 stringify!(reserved)
5268 )
5269 );
5270}
5271#[doc = " Parameters for keyed mutex objects"]
5272#[repr(C)]
5273#[derive(Debug, Copy, Clone)]
5274pub struct cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3 {
5275 pub key: ::libc::c_ulonglong,
5276}
5277#[test]
5278fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3() {
5279 assert_eq!(
5280 ::std::mem::size_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3>(),
5281 8usize,
5282 concat!(
5283 "Size of: ",
5284 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3)
5285 )
5286 );
5287 assert_eq!(
5288 ::std::mem::align_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3>(),
5289 8usize,
5290 concat!(
5291 "Alignment of ",
5292 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3)
5293 )
5294 );
5295 assert_eq!(
5296 unsafe {
5297 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3>(
5298 )))
5299 .key as *const _ as usize
5300 },
5301 0usize,
5302 concat!(
5303 "Offset of field: ",
5304 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1__bindgen_ty_3),
5305 "::",
5306 stringify!(key)
5307 )
5308 );
5309}
5310#[test]
5311fn bindgen_test_layout_cudaExternalSemaphoreSignalParams__bindgen_ty_1() {
5312 assert_eq!(
5313 ::std::mem::size_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>(),
5314 72usize,
5315 concat!(
5316 "Size of: ",
5317 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1)
5318 )
5319 );
5320 assert_eq!(
5321 ::std::mem::align_of::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>(),
5322 8usize,
5323 concat!(
5324 "Alignment of ",
5325 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1)
5326 )
5327 );
5328 assert_eq!(
5329 unsafe {
5330 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>())).fence
5331 as *const _ as usize
5332 },
5333 0usize,
5334 concat!(
5335 "Offset of field: ",
5336 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1),
5337 "::",
5338 stringify!(fence)
5339 )
5340 );
5341 assert_eq!(
5342 unsafe {
5343 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>())).nvSciSync
5344 as *const _ as usize
5345 },
5346 8usize,
5347 concat!(
5348 "Offset of field: ",
5349 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1),
5350 "::",
5351 stringify!(nvSciSync)
5352 )
5353 );
5354 assert_eq!(
5355 unsafe {
5356 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>())).keyedMutex
5357 as *const _ as usize
5358 },
5359 16usize,
5360 concat!(
5361 "Offset of field: ",
5362 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1),
5363 "::",
5364 stringify!(keyedMutex)
5365 )
5366 );
5367 assert_eq!(
5368 unsafe {
5369 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams__bindgen_ty_1>())).reserved
5370 as *const _ as usize
5371 },
5372 24usize,
5373 concat!(
5374 "Offset of field: ",
5375 stringify!(cudaExternalSemaphoreSignalParams__bindgen_ty_1),
5376 "::",
5377 stringify!(reserved)
5378 )
5379 );
5380}
5381#[test]
5382fn bindgen_test_layout_cudaExternalSemaphoreSignalParams() {
5383 assert_eq!(
5384 ::std::mem::size_of::<cudaExternalSemaphoreSignalParams>(),
5385 144usize,
5386 concat!("Size of: ", stringify!(cudaExternalSemaphoreSignalParams))
5387 );
5388 assert_eq!(
5389 ::std::mem::align_of::<cudaExternalSemaphoreSignalParams>(),
5390 8usize,
5391 concat!(
5392 "Alignment of ",
5393 stringify!(cudaExternalSemaphoreSignalParams)
5394 )
5395 );
5396 assert_eq!(
5397 unsafe {
5398 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams>())).params as *const _
5399 as usize
5400 },
5401 0usize,
5402 concat!(
5403 "Offset of field: ",
5404 stringify!(cudaExternalSemaphoreSignalParams),
5405 "::",
5406 stringify!(params)
5407 )
5408 );
5409 assert_eq!(
5410 unsafe {
5411 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams>())).flags as *const _ as usize
5412 },
5413 72usize,
5414 concat!(
5415 "Offset of field: ",
5416 stringify!(cudaExternalSemaphoreSignalParams),
5417 "::",
5418 stringify!(flags)
5419 )
5420 );
5421 assert_eq!(
5422 unsafe {
5423 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalParams>())).reserved as *const _
5424 as usize
5425 },
5426 76usize,
5427 concat!(
5428 "Offset of field: ",
5429 stringify!(cudaExternalSemaphoreSignalParams),
5430 "::",
5431 stringify!(reserved)
5432 )
5433 );
5434}
5435#[doc = " External semaphore wait parameters, compatible with driver type"]
5436#[repr(C)]
5437#[derive(Copy, Clone)]
5438pub struct cudaExternalSemaphoreWaitParams {
5439 pub params: cudaExternalSemaphoreWaitParams__bindgen_ty_1,
5440 #[doc = " Only when ::cudaExternalSemaphoreSignalParams is used to"]
5441 #[doc = " signal a ::cudaExternalSemaphore_t of type"]
5442 #[doc = " ::cudaExternalSemaphoreHandleTypeNvSciSync, the valid flag is"]
5443 #[doc = " ::cudaExternalSemaphoreSignalSkipNvSciBufMemSync: which indicates"]
5444 #[doc = " that while waiting for the ::cudaExternalSemaphore_t, no memory"]
5445 #[doc = " synchronization operations should be performed for any external memory"]
5446 #[doc = " object imported as ::cudaExternalMemoryHandleTypeNvSciBuf."]
5447 #[doc = " For all other types of ::cudaExternalSemaphore_t, flags must be zero."]
5448 pub flags: ::libc::c_uint,
5449 pub reserved: [::libc::c_uint; 16usize],
5450}
5451#[repr(C)]
5452#[derive(Copy, Clone)]
5453pub struct cudaExternalSemaphoreWaitParams__bindgen_ty_1 {
5454 pub fence: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1,
5455 pub nvSciSync: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2,
5456 pub keyedMutex: cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3,
5457 pub reserved: [::libc::c_uint; 10usize],
5458}
5459#[doc = " Parameters for fence objects"]
5460#[repr(C)]
5461#[derive(Debug, Copy, Clone)]
5462pub struct cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1 {
5463 #[doc = " Value of fence to be waited on"]
5464 pub value: ::libc::c_ulonglong,
5465}
5466#[test]
5467fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1() {
5468 assert_eq!(
5469 ::std::mem::size_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1>(),
5470 8usize,
5471 concat!(
5472 "Size of: ",
5473 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1)
5474 )
5475 );
5476 assert_eq!(
5477 ::std::mem::align_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1>(),
5478 8usize,
5479 concat!(
5480 "Alignment of ",
5481 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1)
5482 )
5483 );
5484 assert_eq!(
5485 unsafe {
5486 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1>()))
5487 .value as *const _ as usize
5488 },
5489 0usize,
5490 concat!(
5491 "Offset of field: ",
5492 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_1),
5493 "::",
5494 stringify!(value)
5495 )
5496 );
5497}
5498#[repr(C)]
5499#[derive(Copy, Clone)]
5500pub union cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2 {
5501 #[doc = " Pointer to NvSciSyncFence. Valid if ::cudaExternalSemaphoreHandleType"]
5502 #[doc = " is of type ::cudaExternalSemaphoreHandleTypeNvSciSync."]
5503 pub fence: *mut ::libc::c_void,
5504 pub reserved: ::libc::c_ulonglong,
5505}
5506#[test]
5507fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2() {
5508 assert_eq!(
5509 ::std::mem::size_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2>(),
5510 8usize,
5511 concat!(
5512 "Size of: ",
5513 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2)
5514 )
5515 );
5516 assert_eq!(
5517 ::std::mem::align_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2>(),
5518 8usize,
5519 concat!(
5520 "Alignment of ",
5521 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2)
5522 )
5523 );
5524 assert_eq!(
5525 unsafe {
5526 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2>()))
5527 .fence as *const _ as usize
5528 },
5529 0usize,
5530 concat!(
5531 "Offset of field: ",
5532 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2),
5533 "::",
5534 stringify!(fence)
5535 )
5536 );
5537 assert_eq!(
5538 unsafe {
5539 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2>()))
5540 .reserved as *const _ as usize
5541 },
5542 0usize,
5543 concat!(
5544 "Offset of field: ",
5545 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_2),
5546 "::",
5547 stringify!(reserved)
5548 )
5549 );
5550}
5551#[doc = " Parameters for keyed mutex objects"]
5552#[repr(C)]
5553#[derive(Debug, Copy, Clone)]
5554pub struct cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3 {
5555 #[doc = " Value of key to acquire the mutex with"]
5556 pub key: ::libc::c_ulonglong,
5557 #[doc = " Timeout in milliseconds to wait to acquire the mutex"]
5558 pub timeoutMs: ::libc::c_uint,
5559}
5560#[test]
5561fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3() {
5562 assert_eq!(
5563 ::std::mem::size_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3>(),
5564 16usize,
5565 concat!(
5566 "Size of: ",
5567 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3)
5568 )
5569 );
5570 assert_eq!(
5571 ::std::mem::align_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3>(),
5572 8usize,
5573 concat!(
5574 "Alignment of ",
5575 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3)
5576 )
5577 );
5578 assert_eq!(
5579 unsafe {
5580 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3>()))
5581 .key as *const _ as usize
5582 },
5583 0usize,
5584 concat!(
5585 "Offset of field: ",
5586 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3),
5587 "::",
5588 stringify!(key)
5589 )
5590 );
5591 assert_eq!(
5592 unsafe {
5593 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3>()))
5594 .timeoutMs as *const _ as usize
5595 },
5596 8usize,
5597 concat!(
5598 "Offset of field: ",
5599 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1__bindgen_ty_3),
5600 "::",
5601 stringify!(timeoutMs)
5602 )
5603 );
5604}
5605#[test]
5606fn bindgen_test_layout_cudaExternalSemaphoreWaitParams__bindgen_ty_1() {
5607 assert_eq!(
5608 ::std::mem::size_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>(),
5609 72usize,
5610 concat!(
5611 "Size of: ",
5612 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1)
5613 )
5614 );
5615 assert_eq!(
5616 ::std::mem::align_of::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>(),
5617 8usize,
5618 concat!(
5619 "Alignment of ",
5620 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1)
5621 )
5622 );
5623 assert_eq!(
5624 unsafe {
5625 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>())).fence
5626 as *const _ as usize
5627 },
5628 0usize,
5629 concat!(
5630 "Offset of field: ",
5631 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1),
5632 "::",
5633 stringify!(fence)
5634 )
5635 );
5636 assert_eq!(
5637 unsafe {
5638 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>())).nvSciSync
5639 as *const _ as usize
5640 },
5641 8usize,
5642 concat!(
5643 "Offset of field: ",
5644 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1),
5645 "::",
5646 stringify!(nvSciSync)
5647 )
5648 );
5649 assert_eq!(
5650 unsafe {
5651 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>())).keyedMutex
5652 as *const _ as usize
5653 },
5654 16usize,
5655 concat!(
5656 "Offset of field: ",
5657 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1),
5658 "::",
5659 stringify!(keyedMutex)
5660 )
5661 );
5662 assert_eq!(
5663 unsafe {
5664 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams__bindgen_ty_1>())).reserved
5665 as *const _ as usize
5666 },
5667 32usize,
5668 concat!(
5669 "Offset of field: ",
5670 stringify!(cudaExternalSemaphoreWaitParams__bindgen_ty_1),
5671 "::",
5672 stringify!(reserved)
5673 )
5674 );
5675}
5676#[test]
5677fn bindgen_test_layout_cudaExternalSemaphoreWaitParams() {
5678 assert_eq!(
5679 ::std::mem::size_of::<cudaExternalSemaphoreWaitParams>(),
5680 144usize,
5681 concat!("Size of: ", stringify!(cudaExternalSemaphoreWaitParams))
5682 );
5683 assert_eq!(
5684 ::std::mem::align_of::<cudaExternalSemaphoreWaitParams>(),
5685 8usize,
5686 concat!("Alignment of ", stringify!(cudaExternalSemaphoreWaitParams))
5687 );
5688 assert_eq!(
5689 unsafe {
5690 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams>())).params as *const _ as usize
5691 },
5692 0usize,
5693 concat!(
5694 "Offset of field: ",
5695 stringify!(cudaExternalSemaphoreWaitParams),
5696 "::",
5697 stringify!(params)
5698 )
5699 );
5700 assert_eq!(
5701 unsafe {
5702 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams>())).flags as *const _ as usize
5703 },
5704 72usize,
5705 concat!(
5706 "Offset of field: ",
5707 stringify!(cudaExternalSemaphoreWaitParams),
5708 "::",
5709 stringify!(flags)
5710 )
5711 );
5712 assert_eq!(
5713 unsafe {
5714 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitParams>())).reserved as *const _
5715 as usize
5716 },
5717 76usize,
5718 concat!(
5719 "Offset of field: ",
5720 stringify!(cudaExternalSemaphoreWaitParams),
5721 "::",
5722 stringify!(reserved)
5723 )
5724 );
5725}
5726#[doc = " CUDA Error types"]
5727pub use self::cudaError as cudaError_t;
5728#[repr(C)]
5729#[derive(Debug, Copy, Clone)]
5730pub struct CUstream_st {
5731 _unused: [u8; 0],
5732}
5733#[doc = " CUDA stream"]
5734pub type cudaStream_t = *mut CUstream_st;
5735#[repr(C)]
5736#[derive(Debug, Copy, Clone)]
5737pub struct CUevent_st {
5738 _unused: [u8; 0],
5739}
5740#[doc = " CUDA event types"]
5741pub type cudaEvent_t = *mut CUevent_st;
5742#[doc = " CUDA graphics resource types"]
5743pub type cudaGraphicsResource_t = *mut cudaGraphicsResource;
5744#[doc = " CUDA output file modes"]
5745pub use self::cudaOutputMode as cudaOutputMode_t;
5746#[repr(C)]
5747#[derive(Debug, Copy, Clone)]
5748pub struct CUexternalMemory_st {
5749 _unused: [u8; 0],
5750}
5751#[doc = " CUDA external memory"]
5752pub type cudaExternalMemory_t = *mut CUexternalMemory_st;
5753#[repr(C)]
5754#[derive(Debug, Copy, Clone)]
5755pub struct CUexternalSemaphore_st {
5756 _unused: [u8; 0],
5757}
5758#[doc = " CUDA external semaphore"]
5759pub type cudaExternalSemaphore_t = *mut CUexternalSemaphore_st;
5760#[repr(C)]
5761#[derive(Debug, Copy, Clone)]
5762pub struct CUgraph_st {
5763 _unused: [u8; 0],
5764}
5765#[doc = " CUDA graph"]
5766pub type cudaGraph_t = *mut CUgraph_st;
5767#[repr(C)]
5768#[derive(Debug, Copy, Clone)]
5769pub struct CUgraphNode_st {
5770 _unused: [u8; 0],
5771}
5772#[doc = " CUDA graph node."]
5773pub type cudaGraphNode_t = *mut CUgraphNode_st;
5774#[repr(C)]
5775#[derive(Debug, Copy, Clone)]
5776pub struct CUuserObject_st {
5777 _unused: [u8; 0],
5778}
5779#[doc = " CUDA user object for graphs"]
5780pub type cudaUserObject_t = *mut CUuserObject_st;
5781#[repr(C)]
5782#[derive(Debug, Copy, Clone)]
5783pub struct CUfunc_st {
5784 _unused: [u8; 0],
5785}
5786#[doc = " CUDA function"]
5787pub type cudaFunction_t = *mut CUfunc_st;
5788#[repr(C)]
5789#[derive(Debug, Copy, Clone)]
5790pub struct CUmemPoolHandle_st {
5791 _unused: [u8; 0],
5792}
5793#[doc = " CUDA memory pool"]
5794pub type cudaMemPool_t = *mut CUmemPoolHandle_st;
5795#[repr(u32)]
5796#[non_exhaustive]
5797#[doc = " CUDA cooperative group scope"]
5798#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5799pub enum cudaCGScope {
5800 #[doc = "< Invalid cooperative group scope"]
5801 cudaCGScopeInvalid = 0,
5802 #[doc = "< Scope represented by a grid_group"]
5803 cudaCGScopeGrid = 1,
5804 #[doc = "< Scope represented by a multi_grid_group"]
5805 cudaCGScopeMultiGrid = 2,
5806}
5807#[doc = " CUDA launch parameters"]
5808#[repr(C)]
5809#[derive(Debug, Copy, Clone)]
5810pub struct cudaLaunchParams {
5811 #[doc = "< Device function symbol"]
5812 pub func: *mut ::libc::c_void,
5813 #[doc = "< Grid dimentions"]
5814 pub gridDim: dim3,
5815 #[doc = "< Block dimentions"]
5816 pub blockDim: dim3,
5817 #[doc = "< Arguments"]
5818 pub args: *mut *mut ::libc::c_void,
5819 #[doc = "< Shared memory"]
5820 pub sharedMem: usize,
5821 #[doc = "< Stream identifier"]
5822 pub stream: cudaStream_t,
5823}
5824#[test]
5825fn bindgen_test_layout_cudaLaunchParams() {
5826 assert_eq!(
5827 ::std::mem::size_of::<cudaLaunchParams>(),
5828 56usize,
5829 concat!("Size of: ", stringify!(cudaLaunchParams))
5830 );
5831 assert_eq!(
5832 ::std::mem::align_of::<cudaLaunchParams>(),
5833 8usize,
5834 concat!("Alignment of ", stringify!(cudaLaunchParams))
5835 );
5836 assert_eq!(
5837 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).func as *const _ as usize },
5838 0usize,
5839 concat!(
5840 "Offset of field: ",
5841 stringify!(cudaLaunchParams),
5842 "::",
5843 stringify!(func)
5844 )
5845 );
5846 assert_eq!(
5847 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).gridDim as *const _ as usize },
5848 8usize,
5849 concat!(
5850 "Offset of field: ",
5851 stringify!(cudaLaunchParams),
5852 "::",
5853 stringify!(gridDim)
5854 )
5855 );
5856 assert_eq!(
5857 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).blockDim as *const _ as usize },
5858 20usize,
5859 concat!(
5860 "Offset of field: ",
5861 stringify!(cudaLaunchParams),
5862 "::",
5863 stringify!(blockDim)
5864 )
5865 );
5866 assert_eq!(
5867 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).args as *const _ as usize },
5868 32usize,
5869 concat!(
5870 "Offset of field: ",
5871 stringify!(cudaLaunchParams),
5872 "::",
5873 stringify!(args)
5874 )
5875 );
5876 assert_eq!(
5877 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).sharedMem as *const _ as usize },
5878 40usize,
5879 concat!(
5880 "Offset of field: ",
5881 stringify!(cudaLaunchParams),
5882 "::",
5883 stringify!(sharedMem)
5884 )
5885 );
5886 assert_eq!(
5887 unsafe { &(*(::std::ptr::null::<cudaLaunchParams>())).stream as *const _ as usize },
5888 48usize,
5889 concat!(
5890 "Offset of field: ",
5891 stringify!(cudaLaunchParams),
5892 "::",
5893 stringify!(stream)
5894 )
5895 );
5896}
5897#[doc = " CUDA GPU kernel node parameters"]
5898#[repr(C)]
5899#[derive(Debug, Copy, Clone)]
5900pub struct cudaKernelNodeParams {
5901 #[doc = "< Kernel to launch"]
5902 pub func: *mut ::libc::c_void,
5903 #[doc = "< Grid dimensions"]
5904 pub gridDim: dim3,
5905 #[doc = "< Block dimensions"]
5906 pub blockDim: dim3,
5907 #[doc = "< Dynamic shared-memory size per thread block in bytes"]
5908 pub sharedMemBytes: ::libc::c_uint,
5909 #[doc = "< Array of pointers to individual kernel arguments"]
5910 pub kernelParams: *mut *mut ::libc::c_void,
5911 #[doc = "< Pointer to kernel arguments in the \"extra\" format"]
5912 pub extra: *mut *mut ::libc::c_void,
5913}
5914#[test]
5915fn bindgen_test_layout_cudaKernelNodeParams() {
5916 assert_eq!(
5917 ::std::mem::size_of::<cudaKernelNodeParams>(),
5918 56usize,
5919 concat!("Size of: ", stringify!(cudaKernelNodeParams))
5920 );
5921 assert_eq!(
5922 ::std::mem::align_of::<cudaKernelNodeParams>(),
5923 8usize,
5924 concat!("Alignment of ", stringify!(cudaKernelNodeParams))
5925 );
5926 assert_eq!(
5927 unsafe { &(*(::std::ptr::null::<cudaKernelNodeParams>())).func as *const _ as usize },
5928 0usize,
5929 concat!(
5930 "Offset of field: ",
5931 stringify!(cudaKernelNodeParams),
5932 "::",
5933 stringify!(func)
5934 )
5935 );
5936 assert_eq!(
5937 unsafe { &(*(::std::ptr::null::<cudaKernelNodeParams>())).gridDim as *const _ as usize },
5938 8usize,
5939 concat!(
5940 "Offset of field: ",
5941 stringify!(cudaKernelNodeParams),
5942 "::",
5943 stringify!(gridDim)
5944 )
5945 );
5946 assert_eq!(
5947 unsafe { &(*(::std::ptr::null::<cudaKernelNodeParams>())).blockDim as *const _ as usize },
5948 20usize,
5949 concat!(
5950 "Offset of field: ",
5951 stringify!(cudaKernelNodeParams),
5952 "::",
5953 stringify!(blockDim)
5954 )
5955 );
5956 assert_eq!(
5957 unsafe {
5958 &(*(::std::ptr::null::<cudaKernelNodeParams>())).sharedMemBytes as *const _ as usize
5959 },
5960 32usize,
5961 concat!(
5962 "Offset of field: ",
5963 stringify!(cudaKernelNodeParams),
5964 "::",
5965 stringify!(sharedMemBytes)
5966 )
5967 );
5968 assert_eq!(
5969 unsafe {
5970 &(*(::std::ptr::null::<cudaKernelNodeParams>())).kernelParams as *const _ as usize
5971 },
5972 40usize,
5973 concat!(
5974 "Offset of field: ",
5975 stringify!(cudaKernelNodeParams),
5976 "::",
5977 stringify!(kernelParams)
5978 )
5979 );
5980 assert_eq!(
5981 unsafe { &(*(::std::ptr::null::<cudaKernelNodeParams>())).extra as *const _ as usize },
5982 48usize,
5983 concat!(
5984 "Offset of field: ",
5985 stringify!(cudaKernelNodeParams),
5986 "::",
5987 stringify!(extra)
5988 )
5989 );
5990}
5991#[doc = " External semaphore signal node parameters"]
5992#[repr(C)]
5993#[derive(Debug, Copy, Clone)]
5994pub struct cudaExternalSemaphoreSignalNodeParams {
5995 #[doc = "< Array of external semaphore handles."]
5996 pub extSemArray: *mut cudaExternalSemaphore_t,
5997 #[doc = "< Array of external semaphore signal parameters."]
5998 pub paramsArray: *const cudaExternalSemaphoreSignalParams,
5999 #[doc = "< Number of handles and parameters supplied in extSemArray and paramsArray."]
6000 pub numExtSems: ::libc::c_uint,
6001}
6002#[test]
6003fn bindgen_test_layout_cudaExternalSemaphoreSignalNodeParams() {
6004 assert_eq!(
6005 ::std::mem::size_of::<cudaExternalSemaphoreSignalNodeParams>(),
6006 24usize,
6007 concat!(
6008 "Size of: ",
6009 stringify!(cudaExternalSemaphoreSignalNodeParams)
6010 )
6011 );
6012 assert_eq!(
6013 ::std::mem::align_of::<cudaExternalSemaphoreSignalNodeParams>(),
6014 8usize,
6015 concat!(
6016 "Alignment of ",
6017 stringify!(cudaExternalSemaphoreSignalNodeParams)
6018 )
6019 );
6020 assert_eq!(
6021 unsafe {
6022 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalNodeParams>())).extSemArray
6023 as *const _ as usize
6024 },
6025 0usize,
6026 concat!(
6027 "Offset of field: ",
6028 stringify!(cudaExternalSemaphoreSignalNodeParams),
6029 "::",
6030 stringify!(extSemArray)
6031 )
6032 );
6033 assert_eq!(
6034 unsafe {
6035 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalNodeParams>())).paramsArray
6036 as *const _ as usize
6037 },
6038 8usize,
6039 concat!(
6040 "Offset of field: ",
6041 stringify!(cudaExternalSemaphoreSignalNodeParams),
6042 "::",
6043 stringify!(paramsArray)
6044 )
6045 );
6046 assert_eq!(
6047 unsafe {
6048 &(*(::std::ptr::null::<cudaExternalSemaphoreSignalNodeParams>())).numExtSems as *const _
6049 as usize
6050 },
6051 16usize,
6052 concat!(
6053 "Offset of field: ",
6054 stringify!(cudaExternalSemaphoreSignalNodeParams),
6055 "::",
6056 stringify!(numExtSems)
6057 )
6058 );
6059}
6060#[doc = " External semaphore wait node parameters"]
6061#[repr(C)]
6062#[derive(Debug, Copy, Clone)]
6063pub struct cudaExternalSemaphoreWaitNodeParams {
6064 #[doc = "< Array of external semaphore handles."]
6065 pub extSemArray: *mut cudaExternalSemaphore_t,
6066 #[doc = "< Array of external semaphore wait parameters."]
6067 pub paramsArray: *const cudaExternalSemaphoreWaitParams,
6068 #[doc = "< Number of handles and parameters supplied in extSemArray and paramsArray."]
6069 pub numExtSems: ::libc::c_uint,
6070}
6071#[test]
6072fn bindgen_test_layout_cudaExternalSemaphoreWaitNodeParams() {
6073 assert_eq!(
6074 ::std::mem::size_of::<cudaExternalSemaphoreWaitNodeParams>(),
6075 24usize,
6076 concat!("Size of: ", stringify!(cudaExternalSemaphoreWaitNodeParams))
6077 );
6078 assert_eq!(
6079 ::std::mem::align_of::<cudaExternalSemaphoreWaitNodeParams>(),
6080 8usize,
6081 concat!(
6082 "Alignment of ",
6083 stringify!(cudaExternalSemaphoreWaitNodeParams)
6084 )
6085 );
6086 assert_eq!(
6087 unsafe {
6088 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitNodeParams>())).extSemArray as *const _
6089 as usize
6090 },
6091 0usize,
6092 concat!(
6093 "Offset of field: ",
6094 stringify!(cudaExternalSemaphoreWaitNodeParams),
6095 "::",
6096 stringify!(extSemArray)
6097 )
6098 );
6099 assert_eq!(
6100 unsafe {
6101 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitNodeParams>())).paramsArray as *const _
6102 as usize
6103 },
6104 8usize,
6105 concat!(
6106 "Offset of field: ",
6107 stringify!(cudaExternalSemaphoreWaitNodeParams),
6108 "::",
6109 stringify!(paramsArray)
6110 )
6111 );
6112 assert_eq!(
6113 unsafe {
6114 &(*(::std::ptr::null::<cudaExternalSemaphoreWaitNodeParams>())).numExtSems as *const _
6115 as usize
6116 },
6117 16usize,
6118 concat!(
6119 "Offset of field: ",
6120 stringify!(cudaExternalSemaphoreWaitNodeParams),
6121 "::",
6122 stringify!(numExtSems)
6123 )
6124 );
6125}
6126#[repr(u32)]
6127#[non_exhaustive]
6128#[doc = " CUDA Graph node types"]
6129#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6130pub enum cudaGraphNodeType {
6131 #[doc = "< GPU kernel node"]
6132 cudaGraphNodeTypeKernel = 0,
6133 #[doc = "< Memcpy node"]
6134 cudaGraphNodeTypeMemcpy = 1,
6135 #[doc = "< Memset node"]
6136 cudaGraphNodeTypeMemset = 2,
6137 #[doc = "< Host (executable) node"]
6138 cudaGraphNodeTypeHost = 3,
6139 #[doc = "< Node which executes an embedded graph"]
6140 cudaGraphNodeTypeGraph = 4,
6141 #[doc = "< Empty (no-op) node"]
6142 cudaGraphNodeTypeEmpty = 5,
6143 #[doc = "< External event wait node"]
6144 cudaGraphNodeTypeWaitEvent = 6,
6145 #[doc = "< External event record node"]
6146 cudaGraphNodeTypeEventRecord = 7,
6147 #[doc = "< External semaphore signal node"]
6148 cudaGraphNodeTypeExtSemaphoreSignal = 8,
6149 #[doc = "< External semaphore wait node"]
6150 cudaGraphNodeTypeExtSemaphoreWait = 9,
6151 #[doc = "< Memory allocation node"]
6152 cudaGraphNodeTypeMemAlloc = 10,
6153 #[doc = "< Memory free node"]
6154 cudaGraphNodeTypeMemFree = 11,
6155 cudaGraphNodeTypeCount = 12,
6156}
6157#[repr(C)]
6158#[derive(Debug, Copy, Clone)]
6159pub struct CUgraphExec_st {
6160 _unused: [u8; 0],
6161}
6162#[doc = " CUDA executable (launchable) graph"]
6163pub type cudaGraphExec_t = *mut CUgraphExec_st;
6164#[repr(u32)]
6165#[non_exhaustive]
6166#[doc = " CUDA Graph Update error types"]
6167#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6168pub enum cudaGraphExecUpdateResult {
6169 #[doc = "< The update succeeded"]
6170 cudaGraphExecUpdateSuccess = 0,
6171 #[doc = "< The update failed for an unexpected reason which is described in the return value of the function"]
6172 cudaGraphExecUpdateError = 1,
6173 #[doc = "< The update failed because the topology changed"]
6174 cudaGraphExecUpdateErrorTopologyChanged = 2,
6175 #[doc = "< The update failed because a node type changed"]
6176 cudaGraphExecUpdateErrorNodeTypeChanged = 3,
6177 #[doc = "< The update failed because the function of a kernel node changed (CUDA driver < 11.2)"]
6178 cudaGraphExecUpdateErrorFunctionChanged = 4,
6179 #[doc = "< The update failed because the parameters changed in a way that is not supported"]
6180 cudaGraphExecUpdateErrorParametersChanged = 5,
6181 #[doc = "< The update failed because something about the node is not supported"]
6182 cudaGraphExecUpdateErrorNotSupported = 6,
6183 #[doc = "< The update failed because the function of a kernel node changed in an unsupported way"]
6184 cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7,
6185}
6186#[repr(u32)]
6187#[non_exhaustive]
6188#[doc = " Flags to specify search options to be used with ::cudaGetDriverEntryPoint"]
6189#[doc = " For more details see ::cuGetProcAddress"]
6190#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6191pub enum cudaGetDriverEntryPointFlags {
6192 #[doc = "< Default search mode for driver symbols."]
6193 cudaEnableDefault = 0,
6194 #[doc = "< Search for legacy versions of driver symbols."]
6195 cudaEnableLegacyStream = 1,
6196 #[doc = "< Search for per-thread versions of driver symbols."]
6197 cudaEnablePerThreadDefaultStream = 2,
6198}
6199#[repr(u32)]
6200#[non_exhaustive]
6201#[doc = " CUDA Graph debug write options"]
6202#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6203pub enum cudaGraphDebugDotFlags {
6204 cudaGraphDebugDotFlagsVerbose = 1,
6205 #[doc = " Output all debug data as if every debug flag is enabled"]
6206 cudaGraphDebugDotFlagsKernelNodeParams = 4,
6207 #[doc = " Adds cudaKernelNodeParams to output"]
6208 cudaGraphDebugDotFlagsMemcpyNodeParams = 8,
6209 #[doc = " Adds cudaMemcpy3DParms to output"]
6210 cudaGraphDebugDotFlagsMemsetNodeParams = 16,
6211 #[doc = " Adds cudaMemsetParams to output"]
6212 cudaGraphDebugDotFlagsHostNodeParams = 32,
6213 #[doc = " Adds cudaHostNodeParams to output"]
6214 cudaGraphDebugDotFlagsEventNodeParams = 64,
6215 #[doc = " Adds cudaEvent_t handle from record and wait nodes to output"]
6216 cudaGraphDebugDotFlagsExtSemasSignalNodeParams = 128,
6217 #[doc = " Adds cudaExternalSemaphoreSignalNodeParams values to output"]
6218 cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 256,
6219 #[doc = " Adds cudaExternalSemaphoreWaitNodeParams to output"]
6220 cudaGraphDebugDotFlagsKernelNodeAttributes = 512,
6221 #[doc = " Adds cudaKernelNodeAttrID values to output"]
6222 cudaGraphDebugDotFlagsHandles = 1024,
6223}
6224#[repr(u32)]
6225#[non_exhaustive]
6226#[doc = " Flags for instantiating a graph"]
6227#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6228pub enum cudaGraphInstantiateFlags {
6229 #[doc = "< Automatically free memory allocated in a graph before relaunching."]
6230 cudaGraphInstantiateFlagAutoFreeOnLaunch = 1,
6231}
6232#[repr(u32)]
6233#[non_exhaustive]
6234#[doc = " CUDA Surface boundary modes"]
6235#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6236pub enum cudaSurfaceBoundaryMode {
6237 #[doc = "< Zero boundary mode"]
6238 cudaBoundaryModeZero = 0,
6239 #[doc = "< Clamp boundary mode"]
6240 cudaBoundaryModeClamp = 1,
6241 #[doc = "< Trap boundary mode"]
6242 cudaBoundaryModeTrap = 2,
6243}
6244#[repr(u32)]
6245#[non_exhaustive]
6246#[doc = " CUDA Surface format modes"]
6247#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6248pub enum cudaSurfaceFormatMode {
6249 #[doc = "< Forced format mode"]
6250 cudaFormatModeForced = 0,
6251 #[doc = "< Auto format mode"]
6252 cudaFormatModeAuto = 1,
6253}
6254#[doc = " CUDA Surface reference"]
6255#[repr(C)]
6256#[derive(Debug, Copy, Clone)]
6257pub struct surfaceReference {
6258 #[doc = " Channel descriptor for surface reference"]
6259 pub channelDesc: cudaChannelFormatDesc,
6260}
6261#[test]
6262fn bindgen_test_layout_surfaceReference() {
6263 assert_eq!(
6264 ::std::mem::size_of::<surfaceReference>(),
6265 20usize,
6266 concat!("Size of: ", stringify!(surfaceReference))
6267 );
6268 assert_eq!(
6269 ::std::mem::align_of::<surfaceReference>(),
6270 4usize,
6271 concat!("Alignment of ", stringify!(surfaceReference))
6272 );
6273 assert_eq!(
6274 unsafe { &(*(::std::ptr::null::<surfaceReference>())).channelDesc as *const _ as usize },
6275 0usize,
6276 concat!(
6277 "Offset of field: ",
6278 stringify!(surfaceReference),
6279 "::",
6280 stringify!(channelDesc)
6281 )
6282 );
6283}
6284#[doc = " An opaque value that represents a CUDA Surface object"]
6285pub type cudaSurfaceObject_t = ::libc::c_ulonglong;
6286#[repr(u32)]
6287#[non_exhaustive]
6288#[doc = " CUDA texture address modes"]
6289#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6290pub enum cudaTextureAddressMode {
6291 #[doc = "< Wrapping address mode"]
6292 cudaAddressModeWrap = 0,
6293 #[doc = "< Clamp to edge address mode"]
6294 cudaAddressModeClamp = 1,
6295 #[doc = "< Mirror address mode"]
6296 cudaAddressModeMirror = 2,
6297 #[doc = "< Border address mode"]
6298 cudaAddressModeBorder = 3,
6299}
6300#[repr(u32)]
6301#[non_exhaustive]
6302#[doc = " CUDA texture filter modes"]
6303#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6304pub enum cudaTextureFilterMode {
6305 #[doc = "< Point filter mode"]
6306 cudaFilterModePoint = 0,
6307 #[doc = "< Linear filter mode"]
6308 cudaFilterModeLinear = 1,
6309}
6310#[repr(u32)]
6311#[non_exhaustive]
6312#[doc = " CUDA texture read modes"]
6313#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6314pub enum cudaTextureReadMode {
6315 #[doc = "< Read texture as specified element type"]
6316 cudaReadModeElementType = 0,
6317 #[doc = "< Read texture as normalized float"]
6318 cudaReadModeNormalizedFloat = 1,
6319}
6320#[doc = " CUDA texture reference"]
6321#[repr(C)]
6322#[derive(Debug, Copy, Clone)]
6323pub struct textureReference {
6324 #[doc = " Indicates whether texture reads are normalized or not"]
6325 pub normalized: ::libc::c_int,
6326 #[doc = " Texture filter mode"]
6327 pub filterMode: cudaTextureFilterMode,
6328 #[doc = " Texture address mode for up to 3 dimensions"]
6329 pub addressMode: [cudaTextureAddressMode; 3usize],
6330 #[doc = " Channel descriptor for the texture reference"]
6331 pub channelDesc: cudaChannelFormatDesc,
6332 #[doc = " Perform sRGB->linear conversion during texture read"]
6333 pub sRGB: ::libc::c_int,
6334 #[doc = " Limit to the anisotropy ratio"]
6335 pub maxAnisotropy: ::libc::c_uint,
6336 #[doc = " Mipmap filter mode"]
6337 pub mipmapFilterMode: cudaTextureFilterMode,
6338 #[doc = " Offset applied to the supplied mipmap level"]
6339 pub mipmapLevelBias: f32,
6340 #[doc = " Lower end of the mipmap level range to clamp access to"]
6341 pub minMipmapLevelClamp: f32,
6342 #[doc = " Upper end of the mipmap level range to clamp access to"]
6343 pub maxMipmapLevelClamp: f32,
6344 #[doc = " Disable any trilinear filtering optimizations."]
6345 pub disableTrilinearOptimization: ::libc::c_int,
6346 pub __cudaReserved: [::libc::c_int; 14usize],
6347}
6348#[test]
6349fn bindgen_test_layout_textureReference() {
6350 assert_eq!(
6351 ::std::mem::size_of::<textureReference>(),
6352 124usize,
6353 concat!("Size of: ", stringify!(textureReference))
6354 );
6355 assert_eq!(
6356 ::std::mem::align_of::<textureReference>(),
6357 4usize,
6358 concat!("Alignment of ", stringify!(textureReference))
6359 );
6360 assert_eq!(
6361 unsafe { &(*(::std::ptr::null::<textureReference>())).normalized as *const _ as usize },
6362 0usize,
6363 concat!(
6364 "Offset of field: ",
6365 stringify!(textureReference),
6366 "::",
6367 stringify!(normalized)
6368 )
6369 );
6370 assert_eq!(
6371 unsafe { &(*(::std::ptr::null::<textureReference>())).filterMode as *const _ as usize },
6372 4usize,
6373 concat!(
6374 "Offset of field: ",
6375 stringify!(textureReference),
6376 "::",
6377 stringify!(filterMode)
6378 )
6379 );
6380 assert_eq!(
6381 unsafe { &(*(::std::ptr::null::<textureReference>())).addressMode as *const _ as usize },
6382 8usize,
6383 concat!(
6384 "Offset of field: ",
6385 stringify!(textureReference),
6386 "::",
6387 stringify!(addressMode)
6388 )
6389 );
6390 assert_eq!(
6391 unsafe { &(*(::std::ptr::null::<textureReference>())).channelDesc as *const _ as usize },
6392 20usize,
6393 concat!(
6394 "Offset of field: ",
6395 stringify!(textureReference),
6396 "::",
6397 stringify!(channelDesc)
6398 )
6399 );
6400 assert_eq!(
6401 unsafe { &(*(::std::ptr::null::<textureReference>())).sRGB as *const _ as usize },
6402 40usize,
6403 concat!(
6404 "Offset of field: ",
6405 stringify!(textureReference),
6406 "::",
6407 stringify!(sRGB)
6408 )
6409 );
6410 assert_eq!(
6411 unsafe { &(*(::std::ptr::null::<textureReference>())).maxAnisotropy as *const _ as usize },
6412 44usize,
6413 concat!(
6414 "Offset of field: ",
6415 stringify!(textureReference),
6416 "::",
6417 stringify!(maxAnisotropy)
6418 )
6419 );
6420 assert_eq!(
6421 unsafe {
6422 &(*(::std::ptr::null::<textureReference>())).mipmapFilterMode as *const _ as usize
6423 },
6424 48usize,
6425 concat!(
6426 "Offset of field: ",
6427 stringify!(textureReference),
6428 "::",
6429 stringify!(mipmapFilterMode)
6430 )
6431 );
6432 assert_eq!(
6433 unsafe {
6434 &(*(::std::ptr::null::<textureReference>())).mipmapLevelBias as *const _ as usize
6435 },
6436 52usize,
6437 concat!(
6438 "Offset of field: ",
6439 stringify!(textureReference),
6440 "::",
6441 stringify!(mipmapLevelBias)
6442 )
6443 );
6444 assert_eq!(
6445 unsafe {
6446 &(*(::std::ptr::null::<textureReference>())).minMipmapLevelClamp as *const _ as usize
6447 },
6448 56usize,
6449 concat!(
6450 "Offset of field: ",
6451 stringify!(textureReference),
6452 "::",
6453 stringify!(minMipmapLevelClamp)
6454 )
6455 );
6456 assert_eq!(
6457 unsafe {
6458 &(*(::std::ptr::null::<textureReference>())).maxMipmapLevelClamp as *const _ as usize
6459 },
6460 60usize,
6461 concat!(
6462 "Offset of field: ",
6463 stringify!(textureReference),
6464 "::",
6465 stringify!(maxMipmapLevelClamp)
6466 )
6467 );
6468 assert_eq!(
6469 unsafe {
6470 &(*(::std::ptr::null::<textureReference>())).disableTrilinearOptimization as *const _
6471 as usize
6472 },
6473 64usize,
6474 concat!(
6475 "Offset of field: ",
6476 stringify!(textureReference),
6477 "::",
6478 stringify!(disableTrilinearOptimization)
6479 )
6480 );
6481 assert_eq!(
6482 unsafe { &(*(::std::ptr::null::<textureReference>())).__cudaReserved as *const _ as usize },
6483 68usize,
6484 concat!(
6485 "Offset of field: ",
6486 stringify!(textureReference),
6487 "::",
6488 stringify!(__cudaReserved)
6489 )
6490 );
6491}
6492#[doc = " CUDA texture descriptor"]
6493#[repr(C)]
6494#[derive(Debug, Copy, Clone)]
6495pub struct cudaTextureDesc {
6496 #[doc = " Texture address mode for up to 3 dimensions"]
6497 pub addressMode: [cudaTextureAddressMode; 3usize],
6498 #[doc = " Texture filter mode"]
6499 pub filterMode: cudaTextureFilterMode,
6500 #[doc = " Texture read mode"]
6501 pub readMode: cudaTextureReadMode,
6502 #[doc = " Perform sRGB->linear conversion during texture read"]
6503 pub sRGB: ::libc::c_int,
6504 #[doc = " Texture Border Color"]
6505 pub borderColor: [f32; 4usize],
6506 #[doc = " Indicates whether texture reads are normalized or not"]
6507 pub normalizedCoords: ::libc::c_int,
6508 #[doc = " Limit to the anisotropy ratio"]
6509 pub maxAnisotropy: ::libc::c_uint,
6510 #[doc = " Mipmap filter mode"]
6511 pub mipmapFilterMode: cudaTextureFilterMode,
6512 #[doc = " Offset applied to the supplied mipmap level"]
6513 pub mipmapLevelBias: f32,
6514 #[doc = " Lower end of the mipmap level range to clamp access to"]
6515 pub minMipmapLevelClamp: f32,
6516 #[doc = " Upper end of the mipmap level range to clamp access to"]
6517 pub maxMipmapLevelClamp: f32,
6518 #[doc = " Disable any trilinear filtering optimizations."]
6519 pub disableTrilinearOptimization: ::libc::c_int,
6520}
6521#[test]
6522fn bindgen_test_layout_cudaTextureDesc() {
6523 assert_eq!(
6524 ::std::mem::size_of::<cudaTextureDesc>(),
6525 68usize,
6526 concat!("Size of: ", stringify!(cudaTextureDesc))
6527 );
6528 assert_eq!(
6529 ::std::mem::align_of::<cudaTextureDesc>(),
6530 4usize,
6531 concat!("Alignment of ", stringify!(cudaTextureDesc))
6532 );
6533 assert_eq!(
6534 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).addressMode as *const _ as usize },
6535 0usize,
6536 concat!(
6537 "Offset of field: ",
6538 stringify!(cudaTextureDesc),
6539 "::",
6540 stringify!(addressMode)
6541 )
6542 );
6543 assert_eq!(
6544 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).filterMode as *const _ as usize },
6545 12usize,
6546 concat!(
6547 "Offset of field: ",
6548 stringify!(cudaTextureDesc),
6549 "::",
6550 stringify!(filterMode)
6551 )
6552 );
6553 assert_eq!(
6554 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).readMode as *const _ as usize },
6555 16usize,
6556 concat!(
6557 "Offset of field: ",
6558 stringify!(cudaTextureDesc),
6559 "::",
6560 stringify!(readMode)
6561 )
6562 );
6563 assert_eq!(
6564 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).sRGB as *const _ as usize },
6565 20usize,
6566 concat!(
6567 "Offset of field: ",
6568 stringify!(cudaTextureDesc),
6569 "::",
6570 stringify!(sRGB)
6571 )
6572 );
6573 assert_eq!(
6574 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).borderColor as *const _ as usize },
6575 24usize,
6576 concat!(
6577 "Offset of field: ",
6578 stringify!(cudaTextureDesc),
6579 "::",
6580 stringify!(borderColor)
6581 )
6582 );
6583 assert_eq!(
6584 unsafe {
6585 &(*(::std::ptr::null::<cudaTextureDesc>())).normalizedCoords as *const _ as usize
6586 },
6587 40usize,
6588 concat!(
6589 "Offset of field: ",
6590 stringify!(cudaTextureDesc),
6591 "::",
6592 stringify!(normalizedCoords)
6593 )
6594 );
6595 assert_eq!(
6596 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).maxAnisotropy as *const _ as usize },
6597 44usize,
6598 concat!(
6599 "Offset of field: ",
6600 stringify!(cudaTextureDesc),
6601 "::",
6602 stringify!(maxAnisotropy)
6603 )
6604 );
6605 assert_eq!(
6606 unsafe {
6607 &(*(::std::ptr::null::<cudaTextureDesc>())).mipmapFilterMode as *const _ as usize
6608 },
6609 48usize,
6610 concat!(
6611 "Offset of field: ",
6612 stringify!(cudaTextureDesc),
6613 "::",
6614 stringify!(mipmapFilterMode)
6615 )
6616 );
6617 assert_eq!(
6618 unsafe { &(*(::std::ptr::null::<cudaTextureDesc>())).mipmapLevelBias as *const _ as usize },
6619 52usize,
6620 concat!(
6621 "Offset of field: ",
6622 stringify!(cudaTextureDesc),
6623 "::",
6624 stringify!(mipmapLevelBias)
6625 )
6626 );
6627 assert_eq!(
6628 unsafe {
6629 &(*(::std::ptr::null::<cudaTextureDesc>())).minMipmapLevelClamp as *const _ as usize
6630 },
6631 56usize,
6632 concat!(
6633 "Offset of field: ",
6634 stringify!(cudaTextureDesc),
6635 "::",
6636 stringify!(minMipmapLevelClamp)
6637 )
6638 );
6639 assert_eq!(
6640 unsafe {
6641 &(*(::std::ptr::null::<cudaTextureDesc>())).maxMipmapLevelClamp as *const _ as usize
6642 },
6643 60usize,
6644 concat!(
6645 "Offset of field: ",
6646 stringify!(cudaTextureDesc),
6647 "::",
6648 stringify!(maxMipmapLevelClamp)
6649 )
6650 );
6651 assert_eq!(
6652 unsafe {
6653 &(*(::std::ptr::null::<cudaTextureDesc>())).disableTrilinearOptimization as *const _
6654 as usize
6655 },
6656 64usize,
6657 concat!(
6658 "Offset of field: ",
6659 stringify!(cudaTextureDesc),
6660 "::",
6661 stringify!(disableTrilinearOptimization)
6662 )
6663 );
6664}
6665#[doc = " An opaque value that represents a CUDA texture object"]
6666pub type cudaTextureObject_t = ::libc::c_ulonglong;
6667#[repr(u32)]
6668#[non_exhaustive]
6669#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6670pub enum cudaDataType_t {
6671 CUDA_R_16F = 2,
6672 CUDA_C_16F = 6,
6673 CUDA_R_16BF = 14,
6674 CUDA_C_16BF = 15,
6675 CUDA_R_32F = 0,
6676 CUDA_C_32F = 4,
6677 CUDA_R_64F = 1,
6678 CUDA_C_64F = 5,
6679 CUDA_R_4I = 16,
6680 CUDA_C_4I = 17,
6681 CUDA_R_4U = 18,
6682 CUDA_C_4U = 19,
6683 CUDA_R_8I = 3,
6684 CUDA_C_8I = 7,
6685 CUDA_R_8U = 8,
6686 CUDA_C_8U = 9,
6687 CUDA_R_16I = 20,
6688 CUDA_C_16I = 21,
6689 CUDA_R_16U = 22,
6690 CUDA_C_16U = 23,
6691 CUDA_R_32I = 10,
6692 CUDA_C_32I = 11,
6693 CUDA_R_32U = 12,
6694 CUDA_C_32U = 13,
6695 CUDA_R_64I = 24,
6696 CUDA_C_64I = 25,
6697 CUDA_R_64U = 26,
6698 CUDA_C_64U = 27,
6699}
6700pub use self::cudaDataType_t as cudaDataType;
6701pub const libraryPropertyType_t_MAJOR_VERSION: libraryPropertyType_t = 0;
6702pub const libraryPropertyType_t_MINOR_VERSION: libraryPropertyType_t = 1;
6703pub const libraryPropertyType_t_PATCH_LEVEL: libraryPropertyType_t = 2;
6704pub type libraryPropertyType_t = ::libc::c_uint;
6705pub use self::libraryPropertyType_t as libraryPropertyType;
6706extern "C" {
6707 #[doc = " \\brief Destroy all allocations and reset all state on the current device"]
6708 #[doc = " in the current process."]
6709 #[doc = ""]
6710 #[doc = " Explicitly destroys and cleans up all resources associated with the current"]
6711 #[doc = " device in the current process. Any subsequent API call to this device will"]
6712 #[doc = " reinitialize the device."]
6713 #[doc = ""]
6714 #[doc = " Note that this function will reset the device immediately. It is the caller's"]
6715 #[doc = " responsibility to ensure that the device is not being accessed by any"]
6716 #[doc = " other host threads from the process when this function is called."]
6717 #[doc = ""]
6718 #[doc = " \\return"]
6719 #[doc = " ::cudaSuccess"]
6720 #[doc = " \\notefnerr"]
6721 #[doc = " \\note_init_rt"]
6722 #[doc = " \\note_callback"]
6723 #[doc = ""]
6724 #[doc = " \\sa ::cudaDeviceSynchronize"]
6725 pub fn cudaDeviceReset() -> cudaError_t;
6726}
6727extern "C" {
6728 #[doc = " \\brief Wait for compute device to finish"]
6729 #[doc = ""]
6730 #[doc = " Blocks until the device has completed all preceding requested tasks."]
6731 #[doc = " ::cudaDeviceSynchronize() returns an error if one of the preceding tasks"]
6732 #[doc = " has failed. If the ::cudaDeviceScheduleBlockingSync flag was set for"]
6733 #[doc = " this device, the host thread will block until the device has finished"]
6734 #[doc = " its work."]
6735 #[doc = ""]
6736 #[doc = " \\return"]
6737 #[doc = " ::cudaSuccess"]
6738 #[doc = " \\notefnerr"]
6739 #[doc = " \\note_init_rt"]
6740 #[doc = " \\note_callback"]
6741 #[doc = ""]
6742 #[doc = " \\sa"]
6743 #[doc = " ::cudaDeviceReset,"]
6744 #[doc = " ::cuCtxSynchronize"]
6745 pub fn cudaDeviceSynchronize() -> cudaError_t;
6746}
6747extern "C" {
6748 #[doc = " \\brief Set resource limits"]
6749 #[doc = ""]
6750 #[doc = " Setting \\p limit to \\p value is a request by the application to update"]
6751 #[doc = " the current limit maintained by the device. The driver is free to"]
6752 #[doc = " modify the requested value to meet h/w requirements (this could be"]
6753 #[doc = " clamping to minimum or maximum values, rounding up to nearest element"]
6754 #[doc = " size, etc). The application can use ::cudaDeviceGetLimit() to find out"]
6755 #[doc = " exactly what the limit has been set to."]
6756 #[doc = ""]
6757 #[doc = " Setting each ::cudaLimit has its own specific restrictions, so each is"]
6758 #[doc = " discussed here."]
6759 #[doc = ""]
6760 #[doc = " - ::cudaLimitStackSize controls the stack size in bytes of each GPU thread."]
6761 #[doc = ""]
6762 #[doc = " - ::cudaLimitPrintfFifoSize controls the size in bytes of the shared FIFO"]
6763 #[doc = " used by the ::printf() device system call. Setting"]
6764 #[doc = " ::cudaLimitPrintfFifoSize must not be performed after launching any kernel"]
6765 #[doc = " that uses the ::printf() device system call - in such case"]
6766 #[doc = " ::cudaErrorInvalidValue will be returned."]
6767 #[doc = ""]
6768 #[doc = " - ::cudaLimitMallocHeapSize controls the size in bytes of the heap used by"]
6769 #[doc = " the ::malloc() and ::free() device system calls. Setting"]
6770 #[doc = " ::cudaLimitMallocHeapSize must not be performed after launching any kernel"]
6771 #[doc = " that uses the ::malloc() or ::free() device system calls - in such case"]
6772 #[doc = " ::cudaErrorInvalidValue will be returned."]
6773 #[doc = ""]
6774 #[doc = " - ::cudaLimitDevRuntimeSyncDepth controls the maximum nesting depth of a"]
6775 #[doc = " grid at which a thread can safely call ::cudaDeviceSynchronize(). Setting"]
6776 #[doc = " this limit must be performed before any launch of a kernel that uses the"]
6777 #[doc = " device runtime and calls ::cudaDeviceSynchronize() above the default sync"]
6778 #[doc = " depth, two levels of grids. Calls to ::cudaDeviceSynchronize() will fail"]
6779 #[doc = " with error code ::cudaErrorSyncDepthExceeded if the limitation is"]
6780 #[doc = " violated. This limit can be set smaller than the default or up the maximum"]
6781 #[doc = " launch depth of 24. When setting this limit, keep in mind that additional"]
6782 #[doc = " levels of sync depth require the runtime to reserve large amounts of"]
6783 #[doc = " device memory which can no longer be used for user allocations. If these"]
6784 #[doc = " reservations of device memory fail, ::cudaDeviceSetLimit will return"]
6785 #[doc = " ::cudaErrorMemoryAllocation, and the limit can be reset to a lower value."]
6786 #[doc = " This limit is only applicable to devices of compute capability 3.5 and"]
6787 #[doc = " higher. Attempting to set this limit on devices of compute capability less"]
6788 #[doc = " than 3.5 will result in the error ::cudaErrorUnsupportedLimit being"]
6789 #[doc = " returned."]
6790 #[doc = ""]
6791 #[doc = " - ::cudaLimitDevRuntimePendingLaunchCount controls the maximum number of"]
6792 #[doc = " outstanding device runtime launches that can be made from the current"]
6793 #[doc = " device. A grid is outstanding from the point of launch up until the grid"]
6794 #[doc = " is known to have been completed. Device runtime launches which violate"]
6795 #[doc = " this limitation fail and return ::cudaErrorLaunchPendingCountExceeded when"]
6796 #[doc = " ::cudaGetLastError() is called after launch. If more pending launches than"]
6797 #[doc = " the default (2048 launches) are needed for a module using the device"]
6798 #[doc = " runtime, this limit can be increased. Keep in mind that being able to"]
6799 #[doc = " sustain additional pending launches will require the runtime to reserve"]
6800 #[doc = " larger amounts of device memory upfront which can no longer be used for"]
6801 #[doc = " allocations. If these reservations fail, ::cudaDeviceSetLimit will return"]
6802 #[doc = " ::cudaErrorMemoryAllocation, and the limit can be reset to a lower value."]
6803 #[doc = " This limit is only applicable to devices of compute capability 3.5 and"]
6804 #[doc = " higher. Attempting to set this limit on devices of compute capability less"]
6805 #[doc = " than 3.5 will result in the error ::cudaErrorUnsupportedLimit being"]
6806 #[doc = " returned."]
6807 #[doc = ""]
6808 #[doc = " - ::cudaLimitMaxL2FetchGranularity controls the L2 cache fetch granularity."]
6809 #[doc = " Values can range from 0B to 128B. This is purely a performance hint and"]
6810 #[doc = " it can be ignored or clamped depending on the platform."]
6811 #[doc = ""]
6812 #[doc = " - ::cudaLimitPersistingL2CacheSize controls size in bytes available"]
6813 #[doc = " for persisting L2 cache. This is purely a performance hint and it"]
6814 #[doc = " can be ignored or clamped depending on the platform."]
6815 #[doc = ""]
6816 #[doc = " \\param limit - Limit to set"]
6817 #[doc = " \\param value - Size of limit"]
6818 #[doc = ""]
6819 #[doc = " \\return"]
6820 #[doc = " ::cudaSuccess,"]
6821 #[doc = " ::cudaErrorUnsupportedLimit,"]
6822 #[doc = " ::cudaErrorInvalidValue,"]
6823 #[doc = " ::cudaErrorMemoryAllocation"]
6824 #[doc = " \\notefnerr"]
6825 #[doc = " \\note_init_rt"]
6826 #[doc = " \\note_callback"]
6827 #[doc = ""]
6828 #[doc = " \\sa"]
6829 #[doc = " ::cudaDeviceGetLimit,"]
6830 #[doc = " ::cuCtxSetLimit"]
6831 pub fn cudaDeviceSetLimit(limit: cudaLimit, value: usize) -> cudaError_t;
6832}
6833extern "C" {
6834 #[doc = " \\brief Returns resource limits"]
6835 #[doc = ""]
6836 #[doc = " Returns in \\p *pValue the current size of \\p limit. The supported"]
6837 #[doc = " ::cudaLimit values are:"]
6838 #[doc = " - ::cudaLimitStackSize: stack size in bytes of each GPU thread;"]
6839 #[doc = " - ::cudaLimitPrintfFifoSize: size in bytes of the shared FIFO used by the"]
6840 #[doc = " ::printf() device system call."]
6841 #[doc = " - ::cudaLimitMallocHeapSize: size in bytes of the heap used by the"]
6842 #[doc = " ::malloc() and ::free() device system calls;"]
6843 #[doc = " - ::cudaLimitDevRuntimeSyncDepth: maximum grid depth at which a"]
6844 #[doc = " thread can isssue the device runtime call ::cudaDeviceSynchronize()"]
6845 #[doc = " to wait on child grid launches to complete."]
6846 #[doc = " - ::cudaLimitDevRuntimePendingLaunchCount: maximum number of outstanding"]
6847 #[doc = " device runtime launches."]
6848 #[doc = " - ::cudaLimitMaxL2FetchGranularity: L2 cache fetch granularity."]
6849 #[doc = " - ::cudaLimitPersistingL2CacheSize: Persisting L2 cache size in bytes"]
6850 #[doc = ""]
6851 #[doc = " \\param limit - Limit to query"]
6852 #[doc = " \\param pValue - Returned size of the limit"]
6853 #[doc = ""]
6854 #[doc = " \\return"]
6855 #[doc = " ::cudaSuccess,"]
6856 #[doc = " ::cudaErrorUnsupportedLimit,"]
6857 #[doc = " ::cudaErrorInvalidValue"]
6858 #[doc = " \\notefnerr"]
6859 #[doc = " \\note_init_rt"]
6860 #[doc = " \\note_callback"]
6861 #[doc = ""]
6862 #[doc = " \\sa"]
6863 #[doc = " ::cudaDeviceSetLimit,"]
6864 #[doc = " ::cuCtxGetLimit"]
6865 pub fn cudaDeviceGetLimit(pValue: *mut usize, limit: cudaLimit) -> cudaError_t;
6866}
6867extern "C" {
6868 pub fn cudaDeviceGetTexture1DLinearMaxWidth(
6869 maxWidthInElements: *mut usize,
6870 fmtDesc: *const cudaChannelFormatDesc,
6871 device: ::libc::c_int,
6872 ) -> cudaError_t;
6873}
6874extern "C" {
6875 #[doc = " \\brief Returns the preferred cache configuration for the current device."]
6876 #[doc = ""]
6877 #[doc = " On devices where the L1 cache and shared memory use the same hardware"]
6878 #[doc = " resources, this returns through \\p pCacheConfig the preferred cache"]
6879 #[doc = " configuration for the current device. This is only a preference. The"]
6880 #[doc = " runtime will use the requested configuration if possible, but it is free to"]
6881 #[doc = " choose a different configuration if required to execute functions."]
6882 #[doc = ""]
6883 #[doc = " This will return a \\p pCacheConfig of ::cudaFuncCachePreferNone on devices"]
6884 #[doc = " where the size of the L1 cache and shared memory are fixed."]
6885 #[doc = ""]
6886 #[doc = " The supported cache configurations are:"]
6887 #[doc = " - ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)"]
6888 #[doc = " - ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache"]
6889 #[doc = " - ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory"]
6890 #[doc = " - ::cudaFuncCachePreferEqual: prefer equal size L1 cache and shared memory"]
6891 #[doc = ""]
6892 #[doc = " \\param pCacheConfig - Returned cache configuration"]
6893 #[doc = ""]
6894 #[doc = " \\return"]
6895 #[doc = " ::cudaSuccess"]
6896 #[doc = " \\notefnerr"]
6897 #[doc = " \\note_init_rt"]
6898 #[doc = " \\note_callback"]
6899 #[doc = ""]
6900 #[doc = " \\sa ::cudaDeviceSetCacheConfig,"]
6901 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\","]
6902 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\","]
6903 #[doc = " ::cuCtxGetCacheConfig"]
6904 pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
6905}
6906extern "C" {
6907 #[doc = " \\brief Returns numerical values that correspond to the least and"]
6908 #[doc = " greatest stream priorities."]
6909 #[doc = ""]
6910 #[doc = " Returns in \\p *leastPriority and \\p *greatestPriority the numerical values that correspond"]
6911 #[doc = " to the least and greatest stream priorities respectively. Stream priorities"]
6912 #[doc = " follow a convention where lower numbers imply greater priorities. The range of"]
6913 #[doc = " meaningful stream priorities is given by [\\p *greatestPriority, \\p *leastPriority]."]
6914 #[doc = " If the user attempts to create a stream with a priority value that is"]
6915 #[doc = " outside the the meaningful range as specified by this API, the priority is"]
6916 #[doc = " automatically clamped down or up to either \\p *leastPriority or \\p *greatestPriority"]
6917 #[doc = " respectively. See ::cudaStreamCreateWithPriority for details on creating a"]
6918 #[doc = " priority stream."]
6919 #[doc = " A NULL may be passed in for \\p *leastPriority or \\p *greatestPriority if the value"]
6920 #[doc = " is not desired."]
6921 #[doc = ""]
6922 #[doc = " This function will return '0' in both \\p *leastPriority and \\p *greatestPriority if"]
6923 #[doc = " the current context's device does not support stream priorities"]
6924 #[doc = " (see ::cudaDeviceGetAttribute)."]
6925 #[doc = ""]
6926 #[doc = " \\param leastPriority - Pointer to an int in which the numerical value for least"]
6927 #[doc = " stream priority is returned"]
6928 #[doc = " \\param greatestPriority - Pointer to an int in which the numerical value for greatest"]
6929 #[doc = " stream priority is returned"]
6930 #[doc = ""]
6931 #[doc = " \\return"]
6932 #[doc = " ::cudaSuccess"]
6933 #[doc = " \\notefnerr"]
6934 #[doc = " \\note_init_rt"]
6935 #[doc = " \\note_callback"]
6936 #[doc = ""]
6937 #[doc = " \\sa ::cudaStreamCreateWithPriority,"]
6938 #[doc = " ::cudaStreamGetPriority,"]
6939 #[doc = " ::cuCtxGetStreamPriorityRange"]
6940 pub fn cudaDeviceGetStreamPriorityRange(
6941 leastPriority: *mut ::libc::c_int,
6942 greatestPriority: *mut ::libc::c_int,
6943 ) -> cudaError_t;
6944}
6945extern "C" {
6946 #[doc = " \\brief Sets the preferred cache configuration for the current device."]
6947 #[doc = ""]
6948 #[doc = " On devices where the L1 cache and shared memory use the same hardware"]
6949 #[doc = " resources, this sets through \\p cacheConfig the preferred cache"]
6950 #[doc = " configuration for the current device. This is only a preference. The"]
6951 #[doc = " runtime will use the requested configuration if possible, but it is free to"]
6952 #[doc = " choose a different configuration if required to execute the function. Any"]
6953 #[doc = " function preference set via"]
6954 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\""]
6955 #[doc = " or"]
6956 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\""]
6957 #[doc = " will be preferred over this device-wide setting. Setting the device-wide"]
6958 #[doc = " cache configuration to ::cudaFuncCachePreferNone will cause subsequent"]
6959 #[doc = " kernel launches to prefer to not change the cache configuration unless"]
6960 #[doc = " required to launch the kernel."]
6961 #[doc = ""]
6962 #[doc = " This setting does nothing on devices where the size of the L1 cache and"]
6963 #[doc = " shared memory are fixed."]
6964 #[doc = ""]
6965 #[doc = " Launching a kernel with a different preference than the most recent"]
6966 #[doc = " preference setting may insert a device-side synchronization point."]
6967 #[doc = ""]
6968 #[doc = " The supported cache configurations are:"]
6969 #[doc = " - ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)"]
6970 #[doc = " - ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache"]
6971 #[doc = " - ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory"]
6972 #[doc = " - ::cudaFuncCachePreferEqual: prefer equal size L1 cache and shared memory"]
6973 #[doc = ""]
6974 #[doc = " \\param cacheConfig - Requested cache configuration"]
6975 #[doc = ""]
6976 #[doc = " \\return"]
6977 #[doc = " ::cudaSuccess"]
6978 #[doc = " \\notefnerr"]
6979 #[doc = " \\note_init_rt"]
6980 #[doc = " \\note_callback"]
6981 #[doc = ""]
6982 #[doc = " \\sa ::cudaDeviceGetCacheConfig,"]
6983 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\","]
6984 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\","]
6985 #[doc = " ::cuCtxSetCacheConfig"]
6986 pub fn cudaDeviceSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
6987}
6988extern "C" {
6989 #[doc = " \\brief Returns the shared memory configuration for the current device."]
6990 #[doc = ""]
6991 #[doc = " This function will return in \\p pConfig the current size of shared memory banks"]
6992 #[doc = " on the current device. On devices with configurable shared memory banks,"]
6993 #[doc = " ::cudaDeviceSetSharedMemConfig can be used to change this setting, so that all"]
6994 #[doc = " subsequent kernel launches will by default use the new bank size. When"]
6995 #[doc = " ::cudaDeviceGetSharedMemConfig is called on devices without configurable shared"]
6996 #[doc = " memory, it will return the fixed bank size of the hardware."]
6997 #[doc = ""]
6998 #[doc = " The returned bank configurations can be either:"]
6999 #[doc = " - ::cudaSharedMemBankSizeFourByte - shared memory bank width is four bytes."]
7000 #[doc = " - ::cudaSharedMemBankSizeEightByte - shared memory bank width is eight bytes."]
7001 #[doc = ""]
7002 #[doc = " \\param pConfig - Returned cache configuration"]
7003 #[doc = ""]
7004 #[doc = " \\return"]
7005 #[doc = " ::cudaSuccess,"]
7006 #[doc = " ::cudaErrorInvalidValue"]
7007 #[doc = " \\notefnerr"]
7008 #[doc = " \\note_init_rt"]
7009 #[doc = " \\note_callback"]
7010 #[doc = ""]
7011 #[doc = " \\sa ::cudaDeviceSetCacheConfig,"]
7012 #[doc = " ::cudaDeviceGetCacheConfig,"]
7013 #[doc = " ::cudaDeviceSetSharedMemConfig,"]
7014 #[doc = " ::cudaFuncSetCacheConfig,"]
7015 #[doc = " ::cuCtxGetSharedMemConfig"]
7016 pub fn cudaDeviceGetSharedMemConfig(pConfig: *mut cudaSharedMemConfig) -> cudaError_t;
7017}
7018extern "C" {
7019 #[doc = " \\brief Sets the shared memory configuration for the current device."]
7020 #[doc = ""]
7021 #[doc = " On devices with configurable shared memory banks, this function will set"]
7022 #[doc = " the shared memory bank size which is used for all subsequent kernel launches."]
7023 #[doc = " Any per-function setting of shared memory set via ::cudaFuncSetSharedMemConfig"]
7024 #[doc = " will override the device wide setting."]
7025 #[doc = ""]
7026 #[doc = " Changing the shared memory configuration between launches may introduce"]
7027 #[doc = " a device side synchronization point."]
7028 #[doc = ""]
7029 #[doc = " Changing the shared memory bank size will not increase shared memory usage"]
7030 #[doc = " or affect occupancy of kernels, but may have major effects on performance."]
7031 #[doc = " Larger bank sizes will allow for greater potential bandwidth to shared memory,"]
7032 #[doc = " but will change what kinds of accesses to shared memory will result in bank"]
7033 #[doc = " conflicts."]
7034 #[doc = ""]
7035 #[doc = " This function will do nothing on devices with fixed shared memory bank size."]
7036 #[doc = ""]
7037 #[doc = " The supported bank configurations are:"]
7038 #[doc = " - ::cudaSharedMemBankSizeDefault: set bank width the device default (currently,"]
7039 #[doc = " four bytes)"]
7040 #[doc = " - ::cudaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes"]
7041 #[doc = " natively."]
7042 #[doc = " - ::cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight"]
7043 #[doc = " bytes natively."]
7044 #[doc = ""]
7045 #[doc = " \\param config - Requested cache configuration"]
7046 #[doc = ""]
7047 #[doc = " \\return"]
7048 #[doc = " ::cudaSuccess,"]
7049 #[doc = " ::cudaErrorInvalidValue"]
7050 #[doc = " \\notefnerr"]
7051 #[doc = " \\note_init_rt"]
7052 #[doc = " \\note_callback"]
7053 #[doc = ""]
7054 #[doc = " \\sa ::cudaDeviceSetCacheConfig,"]
7055 #[doc = " ::cudaDeviceGetCacheConfig,"]
7056 #[doc = " ::cudaDeviceGetSharedMemConfig,"]
7057 #[doc = " ::cudaFuncSetCacheConfig,"]
7058 #[doc = " ::cuCtxSetSharedMemConfig"]
7059 pub fn cudaDeviceSetSharedMemConfig(config: cudaSharedMemConfig) -> cudaError_t;
7060}
7061extern "C" {
7062 #[doc = " \\brief Returns a handle to a compute device"]
7063 #[doc = ""]
7064 #[doc = " Returns in \\p *device a device ordinal given a PCI bus ID string."]
7065 #[doc = ""]
7066 #[doc = " \\param device - Returned device ordinal"]
7067 #[doc = ""]
7068 #[doc = " \\param pciBusId - String in one of the following forms:"]
7069 #[doc = " [domain]:[bus]:[device].[function]"]
7070 #[doc = " [domain]:[bus]:[device]"]
7071 #[doc = " [bus]:[device].[function]"]
7072 #[doc = " where \\p domain, \\p bus, \\p device, and \\p function are all hexadecimal values"]
7073 #[doc = ""]
7074 #[doc = " \\return"]
7075 #[doc = " ::cudaSuccess,"]
7076 #[doc = " ::cudaErrorInvalidValue,"]
7077 #[doc = " ::cudaErrorInvalidDevice"]
7078 #[doc = " \\notefnerr"]
7079 #[doc = " \\note_init_rt"]
7080 #[doc = " \\note_callback"]
7081 #[doc = ""]
7082 #[doc = " \\sa"]
7083 #[doc = " ::cudaDeviceGetPCIBusId,"]
7084 #[doc = " ::cuDeviceGetByPCIBusId"]
7085 pub fn cudaDeviceGetByPCIBusId(
7086 device: *mut ::libc::c_int,
7087 pciBusId: *const ::libc::c_char,
7088 ) -> cudaError_t;
7089}
7090extern "C" {
7091 #[doc = " \\brief Returns a PCI Bus Id string for the device"]
7092 #[doc = ""]
7093 #[doc = " Returns an ASCII string identifying the device \\p dev in the NULL-terminated"]
7094 #[doc = " string pointed to by \\p pciBusId. \\p len specifies the maximum length of the"]
7095 #[doc = " string that may be returned."]
7096 #[doc = ""]
7097 #[doc = " \\param pciBusId - Returned identifier string for the device in the following format"]
7098 #[doc = " [domain]:[bus]:[device].[function]"]
7099 #[doc = " where \\p domain, \\p bus, \\p device, and \\p function are all hexadecimal values."]
7100 #[doc = " pciBusId should be large enough to store 13 characters including the NULL-terminator."]
7101 #[doc = ""]
7102 #[doc = " \\param len - Maximum length of string to store in \\p name"]
7103 #[doc = ""]
7104 #[doc = " \\param device - Device to get identifier string for"]
7105 #[doc = ""]
7106 #[doc = " \\return"]
7107 #[doc = " ::cudaSuccess,"]
7108 #[doc = " ::cudaErrorInvalidValue,"]
7109 #[doc = " ::cudaErrorInvalidDevice"]
7110 #[doc = " \\notefnerr"]
7111 #[doc = " \\note_init_rt"]
7112 #[doc = " \\note_callback"]
7113 #[doc = ""]
7114 #[doc = " \\sa"]
7115 #[doc = " ::cudaDeviceGetByPCIBusId,"]
7116 #[doc = " ::cuDeviceGetPCIBusId"]
7117 pub fn cudaDeviceGetPCIBusId(
7118 pciBusId: *mut ::libc::c_char,
7119 len: ::libc::c_int,
7120 device: ::libc::c_int,
7121 ) -> cudaError_t;
7122}
7123extern "C" {
7124 #[doc = " \\brief Gets an interprocess handle for a previously allocated event"]
7125 #[doc = ""]
7126 #[doc = " Takes as input a previously allocated event. This event must have been"]
7127 #[doc = " created with the ::cudaEventInterprocess and ::cudaEventDisableTiming"]
7128 #[doc = " flags set. This opaque handle may be copied into other processes and"]
7129 #[doc = " opened with ::cudaIpcOpenEventHandle to allow efficient hardware"]
7130 #[doc = " synchronization between GPU work in different processes."]
7131 #[doc = ""]
7132 #[doc = " After the event has been been opened in the importing process,"]
7133 #[doc = " ::cudaEventRecord, ::cudaEventSynchronize, ::cudaStreamWaitEvent and"]
7134 #[doc = " ::cudaEventQuery may be used in either process. Performing operations"]
7135 #[doc = " on the imported event after the exported event has been freed"]
7136 #[doc = " with ::cudaEventDestroy will result in undefined behavior."]
7137 #[doc = ""]
7138 #[doc = " IPC functionality is restricted to devices with support for unified"]
7139 #[doc = " addressing on Linux operating systems. IPC functionality is not supported"]
7140 #[doc = " on Tegra platforms."]
7141 #[doc = ""]
7142 #[doc = " \\param handle - Pointer to a user allocated cudaIpcEventHandle"]
7143 #[doc = " in which to return the opaque event handle"]
7144 #[doc = " \\param event - Event allocated with ::cudaEventInterprocess and"]
7145 #[doc = " ::cudaEventDisableTiming flags."]
7146 #[doc = ""]
7147 #[doc = " \\return"]
7148 #[doc = " ::cudaSuccess,"]
7149 #[doc = " ::cudaErrorInvalidResourceHandle,"]
7150 #[doc = " ::cudaErrorMemoryAllocation,"]
7151 #[doc = " ::cudaErrorMapBufferObjectFailed,"]
7152 #[doc = " ::cudaErrorNotSupported,"]
7153 #[doc = " ::cudaErrorInvalidValue"]
7154 #[doc = " \\note_init_rt"]
7155 #[doc = " \\note_callback"]
7156 #[doc = ""]
7157 #[doc = " \\sa"]
7158 #[doc = " ::cudaEventCreate,"]
7159 #[doc = " ::cudaEventDestroy,"]
7160 #[doc = " ::cudaEventSynchronize,"]
7161 #[doc = " ::cudaEventQuery,"]
7162 #[doc = " ::cudaStreamWaitEvent,"]
7163 #[doc = " ::cudaIpcOpenEventHandle,"]
7164 #[doc = " ::cudaIpcGetMemHandle,"]
7165 #[doc = " ::cudaIpcOpenMemHandle,"]
7166 #[doc = " ::cudaIpcCloseMemHandle,"]
7167 #[doc = " ::cuIpcGetEventHandle"]
7168 pub fn cudaIpcGetEventHandle(
7169 handle: *mut cudaIpcEventHandle_t,
7170 event: cudaEvent_t,
7171 ) -> cudaError_t;
7172}
7173extern "C" {
7174 #[doc = " \\brief Opens an interprocess event handle for use in the current process"]
7175 #[doc = ""]
7176 #[doc = " Opens an interprocess event handle exported from another process with"]
7177 #[doc = " ::cudaIpcGetEventHandle. This function returns a ::cudaEvent_t that behaves like"]
7178 #[doc = " a locally created event with the ::cudaEventDisableTiming flag specified."]
7179 #[doc = " This event must be freed with ::cudaEventDestroy."]
7180 #[doc = ""]
7181 #[doc = " Performing operations on the imported event after the exported event has"]
7182 #[doc = " been freed with ::cudaEventDestroy will result in undefined behavior."]
7183 #[doc = ""]
7184 #[doc = " IPC functionality is restricted to devices with support for unified"]
7185 #[doc = " addressing on Linux operating systems. IPC functionality is not supported"]
7186 #[doc = " on Tegra platforms."]
7187 #[doc = ""]
7188 #[doc = " \\param event - Returns the imported event"]
7189 #[doc = " \\param handle - Interprocess handle to open"]
7190 #[doc = ""]
7191 #[doc = " \\returns"]
7192 #[doc = " ::cudaSuccess,"]
7193 #[doc = " ::cudaErrorMapBufferObjectFailed,"]
7194 #[doc = " ::cudaErrorNotSupported,"]
7195 #[doc = " ::cudaErrorInvalidValue,"]
7196 #[doc = " ::cudaErrorDeviceUninitialized"]
7197 #[doc = " \\note_init_rt"]
7198 #[doc = " \\note_callback"]
7199 #[doc = ""]
7200 #[doc = " \\sa"]
7201 #[doc = " ::cudaEventCreate,"]
7202 #[doc = " ::cudaEventDestroy,"]
7203 #[doc = " ::cudaEventSynchronize,"]
7204 #[doc = " ::cudaEventQuery,"]
7205 #[doc = " ::cudaStreamWaitEvent,"]
7206 #[doc = " ::cudaIpcGetEventHandle,"]
7207 #[doc = " ::cudaIpcGetMemHandle,"]
7208 #[doc = " ::cudaIpcOpenMemHandle,"]
7209 #[doc = " ::cudaIpcCloseMemHandle,"]
7210 #[doc = " ::cuIpcOpenEventHandle"]
7211 pub fn cudaIpcOpenEventHandle(
7212 event: *mut cudaEvent_t,
7213 handle: cudaIpcEventHandle_t,
7214 ) -> cudaError_t;
7215}
7216extern "C" {
7217 #[doc = " \\brief Gets an interprocess memory handle for an existing device memory"]
7218 #[doc = " allocation"]
7219 #[doc = ""]
7220 #[doc = " Takes a pointer to the base of an existing device memory allocation created"]
7221 #[doc = " with ::cudaMalloc and exports it for use in another process. This is a"]
7222 #[doc = " lightweight operation and may be called multiple times on an allocation"]
7223 #[doc = " without adverse effects."]
7224 #[doc = ""]
7225 #[doc = " If a region of memory is freed with ::cudaFree and a subsequent call"]
7226 #[doc = " to ::cudaMalloc returns memory with the same device address,"]
7227 #[doc = " ::cudaIpcGetMemHandle will return a unique handle for the"]
7228 #[doc = " new memory."]
7229 #[doc = ""]
7230 #[doc = " IPC functionality is restricted to devices with support for unified"]
7231 #[doc = " addressing on Linux operating systems. IPC functionality is not supported"]
7232 #[doc = " on Tegra platforms."]
7233 #[doc = ""]
7234 #[doc = " \\param handle - Pointer to user allocated ::cudaIpcMemHandle to return"]
7235 #[doc = " the handle in."]
7236 #[doc = " \\param devPtr - Base pointer to previously allocated device memory"]
7237 #[doc = ""]
7238 #[doc = " \\returns"]
7239 #[doc = " ::cudaSuccess,"]
7240 #[doc = " ::cudaErrorMemoryAllocation,"]
7241 #[doc = " ::cudaErrorMapBufferObjectFailed,"]
7242 #[doc = " ::cudaErrorNotSupported,"]
7243 #[doc = " ::cudaErrorInvalidValue"]
7244 #[doc = " \\note_init_rt"]
7245 #[doc = " \\note_callback"]
7246 #[doc = ""]
7247 #[doc = " \\sa"]
7248 #[doc = " ::cudaMalloc,"]
7249 #[doc = " ::cudaFree,"]
7250 #[doc = " ::cudaIpcGetEventHandle,"]
7251 #[doc = " ::cudaIpcOpenEventHandle,"]
7252 #[doc = " ::cudaIpcOpenMemHandle,"]
7253 #[doc = " ::cudaIpcCloseMemHandle,"]
7254 #[doc = " ::cuIpcGetMemHandle"]
7255 pub fn cudaIpcGetMemHandle(
7256 handle: *mut cudaIpcMemHandle_t,
7257 devPtr: *mut ::libc::c_void,
7258 ) -> cudaError_t;
7259}
7260extern "C" {
7261 #[doc = " \\brief Opens an interprocess memory handle exported from another process"]
7262 #[doc = " and returns a device pointer usable in the local process."]
7263 #[doc = ""]
7264 #[doc = " Maps memory exported from another process with ::cudaIpcGetMemHandle into"]
7265 #[doc = " the current device address space. For contexts on different devices"]
7266 #[doc = " ::cudaIpcOpenMemHandle can attempt to enable peer access between the"]
7267 #[doc = " devices as if the user called ::cudaDeviceEnablePeerAccess. This behavior is"]
7268 #[doc = " controlled by the ::cudaIpcMemLazyEnablePeerAccess flag."]
7269 #[doc = " ::cudaDeviceCanAccessPeer can determine if a mapping is possible."]
7270 #[doc = ""]
7271 #[doc = " ::cudaIpcOpenMemHandle can open handles to devices that may not be visible"]
7272 #[doc = " in the process calling the API."]
7273 #[doc = ""]
7274 #[doc = " Contexts that may open ::cudaIpcMemHandles are restricted in the following way."]
7275 #[doc = " ::cudaIpcMemHandles from each device in a given process may only be opened"]
7276 #[doc = " by one context per device per other process."]
7277 #[doc = ""]
7278 #[doc = " If the memory handle has already been opened by the current context, the"]
7279 #[doc = " reference count on the handle is incremented by 1 and the existing device pointer"]
7280 #[doc = " is returned."]
7281 #[doc = ""]
7282 #[doc = " Memory returned from ::cudaIpcOpenMemHandle must be freed with"]
7283 #[doc = " ::cudaIpcCloseMemHandle."]
7284 #[doc = ""]
7285 #[doc = " Calling ::cudaFree on an exported memory region before calling"]
7286 #[doc = " ::cudaIpcCloseMemHandle in the importing context will result in undefined"]
7287 #[doc = " behavior."]
7288 #[doc = ""]
7289 #[doc = " IPC functionality is restricted to devices with support for unified"]
7290 #[doc = " addressing on Linux operating systems. IPC functionality is not supported"]
7291 #[doc = " on Tegra platforms."]
7292 #[doc = ""]
7293 #[doc = " \\param devPtr - Returned device pointer"]
7294 #[doc = " \\param handle - ::cudaIpcMemHandle to open"]
7295 #[doc = " \\param flags - Flags for this operation. Must be specified as ::cudaIpcMemLazyEnablePeerAccess"]
7296 #[doc = ""]
7297 #[doc = " \\returns"]
7298 #[doc = " ::cudaSuccess,"]
7299 #[doc = " ::cudaErrorMapBufferObjectFailed,"]
7300 #[doc = " ::cudaErrorInvalidResourceHandle,"]
7301 #[doc = " ::cudaErrorDeviceUninitialized,"]
7302 #[doc = " ::cudaErrorTooManyPeers,"]
7303 #[doc = " ::cudaErrorNotSupported,"]
7304 #[doc = " ::cudaErrorInvalidValue"]
7305 #[doc = " \\note_init_rt"]
7306 #[doc = " \\note_callback"]
7307 #[doc = ""]
7308 #[doc = " \\note No guarantees are made about the address returned in \\p *devPtr."]
7309 #[doc = " In particular, multiple processes may not receive the same address for the same \\p handle."]
7310 #[doc = ""]
7311 #[doc = " \\sa"]
7312 #[doc = " ::cudaMalloc,"]
7313 #[doc = " ::cudaFree,"]
7314 #[doc = " ::cudaIpcGetEventHandle,"]
7315 #[doc = " ::cudaIpcOpenEventHandle,"]
7316 #[doc = " ::cudaIpcGetMemHandle,"]
7317 #[doc = " ::cudaIpcCloseMemHandle,"]
7318 #[doc = " ::cudaDeviceEnablePeerAccess,"]
7319 #[doc = " ::cudaDeviceCanAccessPeer,"]
7320 #[doc = " ::cuIpcOpenMemHandle"]
7321 pub fn cudaIpcOpenMemHandle(
7322 devPtr: *mut *mut ::libc::c_void,
7323 handle: cudaIpcMemHandle_t,
7324 flags: ::libc::c_uint,
7325 ) -> cudaError_t;
7326}
7327extern "C" {
7328 #[doc = " \\brief Attempts to close memory mapped with cudaIpcOpenMemHandle"]
7329 #[doc = ""]
7330 #[doc = " Decrements the reference count of the memory returnd by ::cudaIpcOpenMemHandle by 1."]
7331 #[doc = " When the reference count reaches 0, this API unmaps the memory. The original allocation"]
7332 #[doc = " in the exporting process as well as imported mappings in other processes"]
7333 #[doc = " will be unaffected."]
7334 #[doc = ""]
7335 #[doc = " Any resources used to enable peer access will be freed if this is the"]
7336 #[doc = " last mapping using them."]
7337 #[doc = ""]
7338 #[doc = " IPC functionality is restricted to devices with support for unified"]
7339 #[doc = " addressing on Linux operating systems. IPC functionality is not supported"]
7340 #[doc = " on Tegra platforms."]
7341 #[doc = ""]
7342 #[doc = " \\param devPtr - Device pointer returned by ::cudaIpcOpenMemHandle"]
7343 #[doc = ""]
7344 #[doc = " \\returns"]
7345 #[doc = " ::cudaSuccess,"]
7346 #[doc = " ::cudaErrorMapBufferObjectFailed,"]
7347 #[doc = " ::cudaErrorNotSupported,"]
7348 #[doc = " ::cudaErrorInvalidValue"]
7349 #[doc = " \\note_init_rt"]
7350 #[doc = " \\note_callback"]
7351 #[doc = ""]
7352 #[doc = " \\sa"]
7353 #[doc = " ::cudaMalloc,"]
7354 #[doc = " ::cudaFree,"]
7355 #[doc = " ::cudaIpcGetEventHandle,"]
7356 #[doc = " ::cudaIpcOpenEventHandle,"]
7357 #[doc = " ::cudaIpcGetMemHandle,"]
7358 #[doc = " ::cudaIpcOpenMemHandle,"]
7359 #[doc = " ::cuIpcCloseMemHandle"]
7360 pub fn cudaIpcCloseMemHandle(devPtr: *mut ::libc::c_void) -> cudaError_t;
7361}
7362extern "C" {
7363 pub fn cudaDeviceFlushGPUDirectRDMAWrites(
7364 target: cudaFlushGPUDirectRDMAWritesTarget,
7365 scope: cudaFlushGPUDirectRDMAWritesScope,
7366 ) -> cudaError_t;
7367}
7368extern "C" {
7369 #[doc = " \\brief Exit and clean up from CUDA launches"]
7370 #[doc = ""]
7371 #[doc = " \\deprecated"]
7372 #[doc = ""]
7373 #[doc = " Note that this function is deprecated because its name does not"]
7374 #[doc = " reflect its behavior. Its functionality is identical to the"]
7375 #[doc = " non-deprecated function ::cudaDeviceReset(), which should be used"]
7376 #[doc = " instead."]
7377 #[doc = ""]
7378 #[doc = " Explicitly destroys all cleans up all resources associated with the current"]
7379 #[doc = " device in the current process. Any subsequent API call to this device will"]
7380 #[doc = " reinitialize the device."]
7381 #[doc = ""]
7382 #[doc = " Note that this function will reset the device immediately. It is the caller's"]
7383 #[doc = " responsibility to ensure that the device is not being accessed by any"]
7384 #[doc = " other host threads from the process when this function is called."]
7385 #[doc = ""]
7386 #[doc = " \\return"]
7387 #[doc = " ::cudaSuccess"]
7388 #[doc = " \\notefnerr"]
7389 #[doc = " \\note_init_rt"]
7390 #[doc = " \\note_callback"]
7391 #[doc = ""]
7392 #[doc = " \\sa ::cudaDeviceReset"]
7393 pub fn cudaThreadExit() -> cudaError_t;
7394}
7395extern "C" {
7396 #[doc = " \\brief Wait for compute device to finish"]
7397 #[doc = ""]
7398 #[doc = " \\deprecated"]
7399 #[doc = ""]
7400 #[doc = " Note that this function is deprecated because its name does not"]
7401 #[doc = " reflect its behavior. Its functionality is similar to the"]
7402 #[doc = " non-deprecated function ::cudaDeviceSynchronize(), which should be used"]
7403 #[doc = " instead."]
7404 #[doc = ""]
7405 #[doc = " Blocks until the device has completed all preceding requested tasks."]
7406 #[doc = " ::cudaThreadSynchronize() returns an error if one of the preceding tasks"]
7407 #[doc = " has failed. If the ::cudaDeviceScheduleBlockingSync flag was set for"]
7408 #[doc = " this device, the host thread will block until the device has finished"]
7409 #[doc = " its work."]
7410 #[doc = ""]
7411 #[doc = " \\return"]
7412 #[doc = " ::cudaSuccess"]
7413 #[doc = " \\notefnerr"]
7414 #[doc = " \\note_init_rt"]
7415 #[doc = " \\note_callback"]
7416 #[doc = ""]
7417 #[doc = " \\sa ::cudaDeviceSynchronize"]
7418 pub fn cudaThreadSynchronize() -> cudaError_t;
7419}
7420extern "C" {
7421 #[doc = " \\brief Set resource limits"]
7422 #[doc = ""]
7423 #[doc = " \\deprecated"]
7424 #[doc = ""]
7425 #[doc = " Note that this function is deprecated because its name does not"]
7426 #[doc = " reflect its behavior. Its functionality is identical to the"]
7427 #[doc = " non-deprecated function ::cudaDeviceSetLimit(), which should be used"]
7428 #[doc = " instead."]
7429 #[doc = ""]
7430 #[doc = " Setting \\p limit to \\p value is a request by the application to update"]
7431 #[doc = " the current limit maintained by the device. The driver is free to"]
7432 #[doc = " modify the requested value to meet h/w requirements (this could be"]
7433 #[doc = " clamping to minimum or maximum values, rounding up to nearest element"]
7434 #[doc = " size, etc). The application can use ::cudaThreadGetLimit() to find out"]
7435 #[doc = " exactly what the limit has been set to."]
7436 #[doc = ""]
7437 #[doc = " Setting each ::cudaLimit has its own specific restrictions, so each is"]
7438 #[doc = " discussed here."]
7439 #[doc = ""]
7440 #[doc = " - ::cudaLimitStackSize controls the stack size of each GPU thread."]
7441 #[doc = ""]
7442 #[doc = " - ::cudaLimitPrintfFifoSize controls the size of the shared FIFO"]
7443 #[doc = " used by the ::printf() device system call."]
7444 #[doc = " Setting ::cudaLimitPrintfFifoSize must be performed before"]
7445 #[doc = " launching any kernel that uses the ::printf() device"]
7446 #[doc = " system call, otherwise ::cudaErrorInvalidValue will be returned."]
7447 #[doc = ""]
7448 #[doc = " - ::cudaLimitMallocHeapSize controls the size of the heap used"]
7449 #[doc = " by the ::malloc() and ::free() device system calls. Setting"]
7450 #[doc = " ::cudaLimitMallocHeapSize must be performed before launching"]
7451 #[doc = " any kernel that uses the ::malloc() or ::free() device system calls,"]
7452 #[doc = " otherwise ::cudaErrorInvalidValue will be returned."]
7453 #[doc = ""]
7454 #[doc = " \\param limit - Limit to set"]
7455 #[doc = " \\param value - Size in bytes of limit"]
7456 #[doc = ""]
7457 #[doc = " \\return"]
7458 #[doc = " ::cudaSuccess,"]
7459 #[doc = " ::cudaErrorUnsupportedLimit,"]
7460 #[doc = " ::cudaErrorInvalidValue"]
7461 #[doc = " \\notefnerr"]
7462 #[doc = " \\note_init_rt"]
7463 #[doc = " \\note_callback"]
7464 #[doc = ""]
7465 #[doc = " \\sa ::cudaDeviceSetLimit"]
7466 pub fn cudaThreadSetLimit(limit: cudaLimit, value: usize) -> cudaError_t;
7467}
7468extern "C" {
7469 #[doc = " \\brief Returns resource limits"]
7470 #[doc = ""]
7471 #[doc = " \\deprecated"]
7472 #[doc = ""]
7473 #[doc = " Note that this function is deprecated because its name does not"]
7474 #[doc = " reflect its behavior. Its functionality is identical to the"]
7475 #[doc = " non-deprecated function ::cudaDeviceGetLimit(), which should be used"]
7476 #[doc = " instead."]
7477 #[doc = ""]
7478 #[doc = " Returns in \\p *pValue the current size of \\p limit. The supported"]
7479 #[doc = " ::cudaLimit values are:"]
7480 #[doc = " - ::cudaLimitStackSize: stack size of each GPU thread;"]
7481 #[doc = " - ::cudaLimitPrintfFifoSize: size of the shared FIFO used by the"]
7482 #[doc = " ::printf() device system call."]
7483 #[doc = " - ::cudaLimitMallocHeapSize: size of the heap used by the"]
7484 #[doc = " ::malloc() and ::free() device system calls;"]
7485 #[doc = ""]
7486 #[doc = " \\param limit - Limit to query"]
7487 #[doc = " \\param pValue - Returned size in bytes of limit"]
7488 #[doc = ""]
7489 #[doc = " \\return"]
7490 #[doc = " ::cudaSuccess,"]
7491 #[doc = " ::cudaErrorUnsupportedLimit,"]
7492 #[doc = " ::cudaErrorInvalidValue"]
7493 #[doc = " \\notefnerr"]
7494 #[doc = " \\note_init_rt"]
7495 #[doc = " \\note_callback"]
7496 #[doc = ""]
7497 #[doc = " \\sa ::cudaDeviceGetLimit"]
7498 pub fn cudaThreadGetLimit(pValue: *mut usize, limit: cudaLimit) -> cudaError_t;
7499}
7500extern "C" {
7501 #[doc = " \\brief Returns the preferred cache configuration for the current device."]
7502 #[doc = ""]
7503 #[doc = " \\deprecated"]
7504 #[doc = ""]
7505 #[doc = " Note that this function is deprecated because its name does not"]
7506 #[doc = " reflect its behavior. Its functionality is identical to the"]
7507 #[doc = " non-deprecated function ::cudaDeviceGetCacheConfig(), which should be"]
7508 #[doc = " used instead."]
7509 #[doc = ""]
7510 #[doc = " On devices where the L1 cache and shared memory use the same hardware"]
7511 #[doc = " resources, this returns through \\p pCacheConfig the preferred cache"]
7512 #[doc = " configuration for the current device. This is only a preference. The"]
7513 #[doc = " runtime will use the requested configuration if possible, but it is free to"]
7514 #[doc = " choose a different configuration if required to execute functions."]
7515 #[doc = ""]
7516 #[doc = " This will return a \\p pCacheConfig of ::cudaFuncCachePreferNone on devices"]
7517 #[doc = " where the size of the L1 cache and shared memory are fixed."]
7518 #[doc = ""]
7519 #[doc = " The supported cache configurations are:"]
7520 #[doc = " - ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)"]
7521 #[doc = " - ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache"]
7522 #[doc = " - ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory"]
7523 #[doc = ""]
7524 #[doc = " \\param pCacheConfig - Returned cache configuration"]
7525 #[doc = ""]
7526 #[doc = " \\return"]
7527 #[doc = " ::cudaSuccess"]
7528 #[doc = " \\notefnerr"]
7529 #[doc = " \\note_init_rt"]
7530 #[doc = " \\note_callback"]
7531 #[doc = ""]
7532 #[doc = " \\sa ::cudaDeviceGetCacheConfig"]
7533 pub fn cudaThreadGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
7534}
7535extern "C" {
7536 #[doc = " \\brief Sets the preferred cache configuration for the current device."]
7537 #[doc = ""]
7538 #[doc = " \\deprecated"]
7539 #[doc = ""]
7540 #[doc = " Note that this function is deprecated because its name does not"]
7541 #[doc = " reflect its behavior. Its functionality is identical to the"]
7542 #[doc = " non-deprecated function ::cudaDeviceSetCacheConfig(), which should be"]
7543 #[doc = " used instead."]
7544 #[doc = ""]
7545 #[doc = " On devices where the L1 cache and shared memory use the same hardware"]
7546 #[doc = " resources, this sets through \\p cacheConfig the preferred cache"]
7547 #[doc = " configuration for the current device. This is only a preference. The"]
7548 #[doc = " runtime will use the requested configuration if possible, but it is free to"]
7549 #[doc = " choose a different configuration if required to execute the function. Any"]
7550 #[doc = " function preference set via"]
7551 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\""]
7552 #[doc = " or"]
7553 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\""]
7554 #[doc = " will be preferred over this device-wide setting. Setting the device-wide"]
7555 #[doc = " cache configuration to ::cudaFuncCachePreferNone will cause subsequent"]
7556 #[doc = " kernel launches to prefer to not change the cache configuration unless"]
7557 #[doc = " required to launch the kernel."]
7558 #[doc = ""]
7559 #[doc = " This setting does nothing on devices where the size of the L1 cache and"]
7560 #[doc = " shared memory are fixed."]
7561 #[doc = ""]
7562 #[doc = " Launching a kernel with a different preference than the most recent"]
7563 #[doc = " preference setting may insert a device-side synchronization point."]
7564 #[doc = ""]
7565 #[doc = " The supported cache configurations are:"]
7566 #[doc = " - ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)"]
7567 #[doc = " - ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache"]
7568 #[doc = " - ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory"]
7569 #[doc = ""]
7570 #[doc = " \\param cacheConfig - Requested cache configuration"]
7571 #[doc = ""]
7572 #[doc = " \\return"]
7573 #[doc = " ::cudaSuccess"]
7574 #[doc = " \\notefnerr"]
7575 #[doc = " \\note_init_rt"]
7576 #[doc = " \\note_callback"]
7577 #[doc = ""]
7578 #[doc = " \\sa ::cudaDeviceSetCacheConfig"]
7579 pub fn cudaThreadSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
7580}
7581extern "C" {
7582 #[doc = " \\brief Returns the last error from a runtime call"]
7583 #[doc = ""]
7584 #[doc = " Returns the last error that has been produced by any of the runtime calls"]
7585 #[doc = " in the same host thread and resets it to ::cudaSuccess."]
7586 #[doc = ""]
7587 #[doc = " \\return"]
7588 #[doc = " ::cudaSuccess,"]
7589 #[doc = " ::cudaErrorMissingConfiguration,"]
7590 #[doc = " ::cudaErrorMemoryAllocation,"]
7591 #[doc = " ::cudaErrorInitializationError,"]
7592 #[doc = " ::cudaErrorLaunchFailure,"]
7593 #[doc = " ::cudaErrorLaunchTimeout,"]
7594 #[doc = " ::cudaErrorLaunchOutOfResources,"]
7595 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
7596 #[doc = " ::cudaErrorInvalidConfiguration,"]
7597 #[doc = " ::cudaErrorInvalidDevice,"]
7598 #[doc = " ::cudaErrorInvalidValue,"]
7599 #[doc = " ::cudaErrorInvalidPitchValue,"]
7600 #[doc = " ::cudaErrorInvalidSymbol,"]
7601 #[doc = " ::cudaErrorUnmapBufferObjectFailed,"]
7602 #[doc = " ::cudaErrorInvalidDevicePointer,"]
7603 #[doc = " ::cudaErrorInvalidTexture,"]
7604 #[doc = " ::cudaErrorInvalidTextureBinding,"]
7605 #[doc = " ::cudaErrorInvalidChannelDescriptor,"]
7606 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
7607 #[doc = " ::cudaErrorInvalidFilterSetting,"]
7608 #[doc = " ::cudaErrorInvalidNormSetting,"]
7609 #[doc = " ::cudaErrorUnknown,"]
7610 #[doc = " ::cudaErrorInvalidResourceHandle,"]
7611 #[doc = " ::cudaErrorInsufficientDriver,"]
7612 #[doc = " ::cudaErrorNoDevice,"]
7613 #[doc = " ::cudaErrorSetOnActiveProcess,"]
7614 #[doc = " ::cudaErrorStartupFailure,"]
7615 #[doc = " ::cudaErrorInvalidPtx,"]
7616 #[doc = " ::cudaErrorUnsupportedPtxVersion,"]
7617 #[doc = " ::cudaErrorNoKernelImageForDevice,"]
7618 #[doc = " ::cudaErrorJitCompilerNotFound,"]
7619 #[doc = " ::cudaErrorJitCompilationDisabled"]
7620 #[doc = " \\notefnerr"]
7621 #[doc = " \\note_init_rt"]
7622 #[doc = " \\note_callback"]
7623 #[doc = ""]
7624 #[doc = " \\sa ::cudaPeekAtLastError, ::cudaGetErrorName, ::cudaGetErrorString, ::cudaError"]
7625 pub fn cudaGetLastError() -> cudaError_t;
7626}
7627extern "C" {
7628 #[doc = " \\brief Returns the last error from a runtime call"]
7629 #[doc = ""]
7630 #[doc = " Returns the last error that has been produced by any of the runtime calls"]
7631 #[doc = " in the same host thread. Note that this call does not reset the error to"]
7632 #[doc = " ::cudaSuccess like ::cudaGetLastError()."]
7633 #[doc = ""]
7634 #[doc = " \\return"]
7635 #[doc = " ::cudaSuccess,"]
7636 #[doc = " ::cudaErrorMissingConfiguration,"]
7637 #[doc = " ::cudaErrorMemoryAllocation,"]
7638 #[doc = " ::cudaErrorInitializationError,"]
7639 #[doc = " ::cudaErrorLaunchFailure,"]
7640 #[doc = " ::cudaErrorLaunchTimeout,"]
7641 #[doc = " ::cudaErrorLaunchOutOfResources,"]
7642 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
7643 #[doc = " ::cudaErrorInvalidConfiguration,"]
7644 #[doc = " ::cudaErrorInvalidDevice,"]
7645 #[doc = " ::cudaErrorInvalidValue,"]
7646 #[doc = " ::cudaErrorInvalidPitchValue,"]
7647 #[doc = " ::cudaErrorInvalidSymbol,"]
7648 #[doc = " ::cudaErrorUnmapBufferObjectFailed,"]
7649 #[doc = " ::cudaErrorInvalidDevicePointer,"]
7650 #[doc = " ::cudaErrorInvalidTexture,"]
7651 #[doc = " ::cudaErrorInvalidTextureBinding,"]
7652 #[doc = " ::cudaErrorInvalidChannelDescriptor,"]
7653 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
7654 #[doc = " ::cudaErrorInvalidFilterSetting,"]
7655 #[doc = " ::cudaErrorInvalidNormSetting,"]
7656 #[doc = " ::cudaErrorUnknown,"]
7657 #[doc = " ::cudaErrorInvalidResourceHandle,"]
7658 #[doc = " ::cudaErrorInsufficientDriver,"]
7659 #[doc = " ::cudaErrorNoDevice,"]
7660 #[doc = " ::cudaErrorSetOnActiveProcess,"]
7661 #[doc = " ::cudaErrorStartupFailure,"]
7662 #[doc = " ::cudaErrorInvalidPtx,"]
7663 #[doc = " ::cudaErrorUnsupportedPtxVersion,"]
7664 #[doc = " ::cudaErrorNoKernelImageForDevice,"]
7665 #[doc = " ::cudaErrorJitCompilerNotFound,"]
7666 #[doc = " ::cudaErrorJitCompilationDisabled"]
7667 #[doc = " \\notefnerr"]
7668 #[doc = " \\note_init_rt"]
7669 #[doc = " \\note_callback"]
7670 #[doc = ""]
7671 #[doc = " \\sa ::cudaGetLastError, ::cudaGetErrorName, ::cudaGetErrorString, ::cudaError"]
7672 pub fn cudaPeekAtLastError() -> cudaError_t;
7673}
7674extern "C" {
7675 #[doc = " \\brief Returns the string representation of an error code enum name"]
7676 #[doc = ""]
7677 #[doc = " Returns a string containing the name of an error code in the enum. If the error"]
7678 #[doc = " code is not recognized, \"unrecognized error code\" is returned."]
7679 #[doc = ""]
7680 #[doc = " \\param error - Error code to convert to string"]
7681 #[doc = ""]
7682 #[doc = " \\return"]
7683 #[doc = " \\p char* pointer to a NULL-terminated string"]
7684 #[doc = ""]
7685 #[doc = " \\sa ::cudaGetErrorString, ::cudaGetLastError, ::cudaPeekAtLastError, ::cudaError,"]
7686 #[doc = " ::cuGetErrorName"]
7687 pub fn cudaGetErrorName(error: cudaError_t) -> *const ::libc::c_char;
7688}
7689extern "C" {
7690 #[doc = " \\brief Returns the description string for an error code"]
7691 #[doc = ""]
7692 #[doc = " Returns the description string for an error code. If the error"]
7693 #[doc = " code is not recognized, \"unrecognized error code\" is returned."]
7694 #[doc = ""]
7695 #[doc = " \\param error - Error code to convert to string"]
7696 #[doc = ""]
7697 #[doc = " \\return"]
7698 #[doc = " \\p char* pointer to a NULL-terminated string"]
7699 #[doc = ""]
7700 #[doc = " \\sa ::cudaGetErrorName, ::cudaGetLastError, ::cudaPeekAtLastError, ::cudaError,"]
7701 #[doc = " ::cuGetErrorString"]
7702 pub fn cudaGetErrorString(error: cudaError_t) -> *const ::libc::c_char;
7703}
7704extern "C" {
7705 #[doc = " \\brief Returns the number of compute-capable devices"]
7706 #[doc = ""]
7707 #[doc = " Returns in \\p *count the number of devices with compute capability greater"]
7708 #[doc = " or equal to 2.0 that are available for execution."]
7709 #[doc = ""]
7710 #[doc = " \\param count - Returns the number of devices with compute capability"]
7711 #[doc = " greater or equal to 2.0"]
7712 #[doc = ""]
7713 #[doc = " \\return"]
7714 #[doc = " ::cudaSuccess"]
7715 #[doc = " \\notefnerr"]
7716 #[doc = " \\note_init_rt"]
7717 #[doc = " \\note_callback"]
7718 #[doc = ""]
7719 #[doc = " \\sa ::cudaGetDevice, ::cudaSetDevice, ::cudaGetDeviceProperties,"]
7720 #[doc = " ::cudaChooseDevice,"]
7721 #[doc = " ::cuDeviceGetCount"]
7722 pub fn cudaGetDeviceCount(count: *mut ::libc::c_int) -> cudaError_t;
7723}
7724extern "C" {
7725 #[doc = " \\brief Returns information about the compute-device"]
7726 #[doc = ""]
7727 #[doc = " Returns in \\p *prop the properties of device \\p dev. The ::cudaDeviceProp"]
7728 #[doc = " structure is defined as:"]
7729 #[doc = " \\code"]
7730 #[doc = "struct cudaDeviceProp {"]
7731 #[doc = "char name[256];"]
7732 #[doc = "cudaUUID_t uuid;"]
7733 #[doc = "size_t totalGlobalMem;"]
7734 #[doc = "size_t sharedMemPerBlock;"]
7735 #[doc = "int regsPerBlock;"]
7736 #[doc = "int warpSize;"]
7737 #[doc = "size_t memPitch;"]
7738 #[doc = "int maxThreadsPerBlock;"]
7739 #[doc = "int maxThreadsDim[3];"]
7740 #[doc = "int maxGridSize[3];"]
7741 #[doc = "int clockRate;"]
7742 #[doc = "size_t totalConstMem;"]
7743 #[doc = "int major;"]
7744 #[doc = "int minor;"]
7745 #[doc = "size_t textureAlignment;"]
7746 #[doc = "size_t texturePitchAlignment;"]
7747 #[doc = "int deviceOverlap;"]
7748 #[doc = "int multiProcessorCount;"]
7749 #[doc = "int kernelExecTimeoutEnabled;"]
7750 #[doc = "int integrated;"]
7751 #[doc = "int canMapHostMemory;"]
7752 #[doc = "int computeMode;"]
7753 #[doc = "int maxTexture1D;"]
7754 #[doc = "int maxTexture1DMipmap;"]
7755 #[doc = "int maxTexture1DLinear;"]
7756 #[doc = "int maxTexture2D[2];"]
7757 #[doc = "int maxTexture2DMipmap[2];"]
7758 #[doc = "int maxTexture2DLinear[3];"]
7759 #[doc = "int maxTexture2DGather[2];"]
7760 #[doc = "int maxTexture3D[3];"]
7761 #[doc = "int maxTexture3DAlt[3];"]
7762 #[doc = "int maxTextureCubemap;"]
7763 #[doc = "int maxTexture1DLayered[2];"]
7764 #[doc = "int maxTexture2DLayered[3];"]
7765 #[doc = "int maxTextureCubemapLayered[2];"]
7766 #[doc = "int maxSurface1D;"]
7767 #[doc = "int maxSurface2D[2];"]
7768 #[doc = "int maxSurface3D[3];"]
7769 #[doc = "int maxSurface1DLayered[2];"]
7770 #[doc = "int maxSurface2DLayered[3];"]
7771 #[doc = "int maxSurfaceCubemap;"]
7772 #[doc = "int maxSurfaceCubemapLayered[2];"]
7773 #[doc = "size_t surfaceAlignment;"]
7774 #[doc = "int concurrentKernels;"]
7775 #[doc = "int ECCEnabled;"]
7776 #[doc = "int pciBusID;"]
7777 #[doc = "int pciDeviceID;"]
7778 #[doc = "int pciDomainID;"]
7779 #[doc = "int tccDriver;"]
7780 #[doc = "int asyncEngineCount;"]
7781 #[doc = "int unifiedAddressing;"]
7782 #[doc = "int memoryClockRate;"]
7783 #[doc = "int memoryBusWidth;"]
7784 #[doc = "int l2CacheSize;"]
7785 #[doc = "int persistingL2CacheMaxSize;"]
7786 #[doc = "int maxThreadsPerMultiProcessor;"]
7787 #[doc = "int streamPrioritiesSupported;"]
7788 #[doc = "int globalL1CacheSupported;"]
7789 #[doc = "int localL1CacheSupported;"]
7790 #[doc = "size_t sharedMemPerMultiprocessor;"]
7791 #[doc = "int regsPerMultiprocessor;"]
7792 #[doc = "int managedMemory;"]
7793 #[doc = "int isMultiGpuBoard;"]
7794 #[doc = "int multiGpuBoardGroupID;"]
7795 #[doc = "int singleToDoublePrecisionPerfRatio;"]
7796 #[doc = "int pageableMemoryAccess;"]
7797 #[doc = "int concurrentManagedAccess;"]
7798 #[doc = "int computePreemptionSupported;"]
7799 #[doc = "int canUseHostPointerForRegisteredMem;"]
7800 #[doc = "int cooperativeLaunch;"]
7801 #[doc = "int cooperativeMultiDeviceLaunch;"]
7802 #[doc = "int pageableMemoryAccessUsesHostPageTables;"]
7803 #[doc = "int directManagedMemAccessFromHost;"]
7804 #[doc = "int accessPolicyMaxWindowSize;"]
7805 #[doc = "}"]
7806 #[doc = "\\endcode"]
7807 #[doc = " where:"]
7808 #[doc = " - \\ref ::cudaDeviceProp::name \"name[256]\" is an ASCII string identifying"]
7809 #[doc = " the device;"]
7810 #[doc = " - \\ref ::cudaDeviceProp::uuid \"uuid\" is a 16-byte unique identifier."]
7811 #[doc = " - \\ref ::cudaDeviceProp::totalGlobalMem \"totalGlobalMem\" is the total"]
7812 #[doc = " amount of global memory available on the device in bytes;"]
7813 #[doc = " - \\ref ::cudaDeviceProp::sharedMemPerBlock \"sharedMemPerBlock\" is the"]
7814 #[doc = " maximum amount of shared memory available to a thread block in bytes;"]
7815 #[doc = " - \\ref ::cudaDeviceProp::regsPerBlock \"regsPerBlock\" is the maximum number"]
7816 #[doc = " of 32-bit registers available to a thread block;"]
7817 #[doc = " - \\ref ::cudaDeviceProp::warpSize \"warpSize\" is the warp size in threads;"]
7818 #[doc = " - \\ref ::cudaDeviceProp::memPitch \"memPitch\" is the maximum pitch in"]
7819 #[doc = " bytes allowed by the memory copy functions that involve memory regions"]
7820 #[doc = " allocated through ::cudaMallocPitch();"]
7821 #[doc = " - \\ref ::cudaDeviceProp::maxThreadsPerBlock \"maxThreadsPerBlock\" is the"]
7822 #[doc = " maximum number of threads per block;"]
7823 #[doc = " - \\ref ::cudaDeviceProp::maxThreadsDim \"maxThreadsDim[3]\" contains the"]
7824 #[doc = " maximum size of each dimension of a block;"]
7825 #[doc = " - \\ref ::cudaDeviceProp::maxGridSize \"maxGridSize[3]\" contains the"]
7826 #[doc = " maximum size of each dimension of a grid;"]
7827 #[doc = " - \\ref ::cudaDeviceProp::clockRate \"clockRate\" is the clock frequency in"]
7828 #[doc = " kilohertz;"]
7829 #[doc = " - \\ref ::cudaDeviceProp::totalConstMem \"totalConstMem\" is the total amount"]
7830 #[doc = " of constant memory available on the device in bytes;"]
7831 #[doc = " - \\ref ::cudaDeviceProp::major \"major\","]
7832 #[doc = " \\ref ::cudaDeviceProp::minor \"minor\" are the major and minor revision"]
7833 #[doc = " numbers defining the device's compute capability;"]
7834 #[doc = " - \\ref ::cudaDeviceProp::textureAlignment \"textureAlignment\" is the"]
7835 #[doc = " alignment requirement; texture base addresses that are aligned to"]
7836 #[doc = " \\ref ::cudaDeviceProp::textureAlignment \"textureAlignment\" bytes do not"]
7837 #[doc = " need an offset applied to texture fetches;"]
7838 #[doc = " - \\ref ::cudaDeviceProp::texturePitchAlignment \"texturePitchAlignment\" is the"]
7839 #[doc = " pitch alignment requirement for 2D texture references that are bound to"]
7840 #[doc = " pitched memory;"]
7841 #[doc = " - \\ref ::cudaDeviceProp::deviceOverlap \"deviceOverlap\" is 1 if the device"]
7842 #[doc = " can concurrently copy memory between host and device while executing a"]
7843 #[doc = " kernel, or 0 if not. Deprecated, use instead asyncEngineCount."]
7844 #[doc = " - \\ref ::cudaDeviceProp::multiProcessorCount \"multiProcessorCount\" is the"]
7845 #[doc = " number of multiprocessors on the device;"]
7846 #[doc = " - \\ref ::cudaDeviceProp::kernelExecTimeoutEnabled \"kernelExecTimeoutEnabled\""]
7847 #[doc = " is 1 if there is a run time limit for kernels executed on the device, or"]
7848 #[doc = " 0 if not."]
7849 #[doc = " - \\ref ::cudaDeviceProp::integrated \"integrated\" is 1 if the device is an"]
7850 #[doc = " integrated (motherboard) GPU and 0 if it is a discrete (card) component."]
7851 #[doc = " - \\ref ::cudaDeviceProp::canMapHostMemory \"canMapHostMemory\" is 1 if the"]
7852 #[doc = " device can map host memory into the CUDA address space for use with"]
7853 #[doc = " ::cudaHostAlloc()/::cudaHostGetDevicePointer(), or 0 if not;"]
7854 #[doc = " - \\ref ::cudaDeviceProp::computeMode \"computeMode\" is the compute mode"]
7855 #[doc = " that the device is currently in. Available modes are as follows:"]
7856 #[doc = " - cudaComputeModeDefault: Default mode - Device is not restricted and"]
7857 #[doc = " multiple threads can use ::cudaSetDevice() with this device."]
7858 #[doc = " - cudaComputeModeExclusive: Compute-exclusive mode - Only one thread will"]
7859 #[doc = " be able to use ::cudaSetDevice() with this device."]
7860 #[doc = " - cudaComputeModeProhibited: Compute-prohibited mode - No threads can use"]
7861 #[doc = " ::cudaSetDevice() with this device."]
7862 #[doc = " - cudaComputeModeExclusiveProcess: Compute-exclusive-process mode - Many"]
7863 #[doc = " threads in one process will be able to use ::cudaSetDevice() with this device."]
7864 #[doc = " <br> If ::cudaSetDevice() is called on an already occupied \\p device with"]
7865 #[doc = " computeMode ::cudaComputeModeExclusive, ::cudaErrorDeviceAlreadyInUse"]
7866 #[doc = " will be immediately returned indicating the device cannot be used."]
7867 #[doc = " When an occupied exclusive mode device is chosen with ::cudaSetDevice,"]
7868 #[doc = " all subsequent non-device management runtime functions will return"]
7869 #[doc = " ::cudaErrorDevicesUnavailable."]
7870 #[doc = " - \\ref ::cudaDeviceProp::maxTexture1D \"maxTexture1D\" is the maximum 1D"]
7871 #[doc = " texture size."]
7872 #[doc = " - \\ref ::cudaDeviceProp::maxTexture1DMipmap \"maxTexture1DMipmap\" is the maximum"]
7873 #[doc = " 1D mipmapped texture texture size."]
7874 #[doc = " - \\ref ::cudaDeviceProp::maxTexture1DLinear \"maxTexture1DLinear\" is the maximum"]
7875 #[doc = " 1D texture size for textures bound to linear memory."]
7876 #[doc = " - \\ref ::cudaDeviceProp::maxTexture2D \"maxTexture2D[2]\" contains the maximum"]
7877 #[doc = " 2D texture dimensions."]
7878 #[doc = " - \\ref ::cudaDeviceProp::maxTexture2DMipmap \"maxTexture2DMipmap[2]\" contains the"]
7879 #[doc = " maximum 2D mipmapped texture dimensions."]
7880 #[doc = " - \\ref ::cudaDeviceProp::maxTexture2DLinear \"maxTexture2DLinear[3]\" contains the"]
7881 #[doc = " maximum 2D texture dimensions for 2D textures bound to pitch linear memory."]
7882 #[doc = " - \\ref ::cudaDeviceProp::maxTexture2DGather \"maxTexture2DGather[2]\" contains the"]
7883 #[doc = " maximum 2D texture dimensions if texture gather operations have to be performed."]
7884 #[doc = " - \\ref ::cudaDeviceProp::maxTexture3D \"maxTexture3D[3]\" contains the maximum"]
7885 #[doc = " 3D texture dimensions."]
7886 #[doc = " - \\ref ::cudaDeviceProp::maxTexture3DAlt \"maxTexture3DAlt[3]\""]
7887 #[doc = " contains the maximum alternate 3D texture dimensions."]
7888 #[doc = " - \\ref ::cudaDeviceProp::maxTextureCubemap \"maxTextureCubemap\" is the"]
7889 #[doc = " maximum cubemap texture width or height."]
7890 #[doc = " - \\ref ::cudaDeviceProp::maxTexture1DLayered \"maxTexture1DLayered[2]\" contains"]
7891 #[doc = " the maximum 1D layered texture dimensions."]
7892 #[doc = " - \\ref ::cudaDeviceProp::maxTexture2DLayered \"maxTexture2DLayered[3]\" contains"]
7893 #[doc = " the maximum 2D layered texture dimensions."]
7894 #[doc = " - \\ref ::cudaDeviceProp::maxTextureCubemapLayered \"maxTextureCubemapLayered[2]\""]
7895 #[doc = " contains the maximum cubemap layered texture dimensions."]
7896 #[doc = " - \\ref ::cudaDeviceProp::maxSurface1D \"maxSurface1D\" is the maximum 1D"]
7897 #[doc = " surface size."]
7898 #[doc = " - \\ref ::cudaDeviceProp::maxSurface2D \"maxSurface2D[2]\" contains the maximum"]
7899 #[doc = " 2D surface dimensions."]
7900 #[doc = " - \\ref ::cudaDeviceProp::maxSurface3D \"maxSurface3D[3]\" contains the maximum"]
7901 #[doc = " 3D surface dimensions."]
7902 #[doc = " - \\ref ::cudaDeviceProp::maxSurface1DLayered \"maxSurface1DLayered[2]\" contains"]
7903 #[doc = " the maximum 1D layered surface dimensions."]
7904 #[doc = " - \\ref ::cudaDeviceProp::maxSurface2DLayered \"maxSurface2DLayered[3]\" contains"]
7905 #[doc = " the maximum 2D layered surface dimensions."]
7906 #[doc = " - \\ref ::cudaDeviceProp::maxSurfaceCubemap \"maxSurfaceCubemap\" is the maximum"]
7907 #[doc = " cubemap surface width or height."]
7908 #[doc = " - \\ref ::cudaDeviceProp::maxSurfaceCubemapLayered \"maxSurfaceCubemapLayered[2]\""]
7909 #[doc = " contains the maximum cubemap layered surface dimensions."]
7910 #[doc = " - \\ref ::cudaDeviceProp::surfaceAlignment \"surfaceAlignment\" specifies the"]
7911 #[doc = " alignment requirements for surfaces."]
7912 #[doc = " - \\ref ::cudaDeviceProp::concurrentKernels \"concurrentKernels\" is 1 if the"]
7913 #[doc = " device supports executing multiple kernels within the same context"]
7914 #[doc = " simultaneously, or 0 if not. It is not guaranteed that multiple kernels"]
7915 #[doc = " will be resident on the device concurrently so this feature should not be"]
7916 #[doc = " relied upon for correctness;"]
7917 #[doc = " - \\ref ::cudaDeviceProp::ECCEnabled \"ECCEnabled\" is 1 if the device has ECC"]
7918 #[doc = " support turned on, or 0 if not."]
7919 #[doc = " - \\ref ::cudaDeviceProp::pciBusID \"pciBusID\" is the PCI bus identifier of"]
7920 #[doc = " the device."]
7921 #[doc = " - \\ref ::cudaDeviceProp::pciDeviceID \"pciDeviceID\" is the PCI device"]
7922 #[doc = " (sometimes called slot) identifier of the device."]
7923 #[doc = " - \\ref ::cudaDeviceProp::pciDomainID \"pciDomainID\" is the PCI domain identifier"]
7924 #[doc = " of the device."]
7925 #[doc = " - \\ref ::cudaDeviceProp::tccDriver \"tccDriver\" is 1 if the device is using a"]
7926 #[doc = " TCC driver or 0 if not."]
7927 #[doc = " - \\ref ::cudaDeviceProp::asyncEngineCount \"asyncEngineCount\" is 1 when the"]
7928 #[doc = " device can concurrently copy memory between host and device while executing"]
7929 #[doc = " a kernel. It is 2 when the device can concurrently copy memory between host"]
7930 #[doc = " and device in both directions and execute a kernel at the same time. It is"]
7931 #[doc = " 0 if neither of these is supported."]
7932 #[doc = " - \\ref ::cudaDeviceProp::unifiedAddressing \"unifiedAddressing\" is 1 if the device"]
7933 #[doc = " shares a unified address space with the host and 0 otherwise."]
7934 #[doc = " - \\ref ::cudaDeviceProp::memoryClockRate \"memoryClockRate\" is the peak memory"]
7935 #[doc = " clock frequency in kilohertz."]
7936 #[doc = " - \\ref ::cudaDeviceProp::memoryBusWidth \"memoryBusWidth\" is the memory bus width"]
7937 #[doc = " in bits."]
7938 #[doc = " - \\ref ::cudaDeviceProp::l2CacheSize \"l2CacheSize\" is L2 cache size in bytes."]
7939 #[doc = " - \\ref ::cudaDeviceProp::persistingL2CacheMaxSize \"persistingL2CacheMaxSize\" is L2 cache's maximum persisting lines size in bytes."]
7940 #[doc = " - \\ref ::cudaDeviceProp::maxThreadsPerMultiProcessor \"maxThreadsPerMultiProcessor\""]
7941 #[doc = " is the number of maximum resident threads per multiprocessor."]
7942 #[doc = " - \\ref ::cudaDeviceProp::streamPrioritiesSupported \"streamPrioritiesSupported\""]
7943 #[doc = " is 1 if the device supports stream priorities, or 0 if it is not supported."]
7944 #[doc = " - \\ref ::cudaDeviceProp::globalL1CacheSupported \"globalL1CacheSupported\""]
7945 #[doc = " is 1 if the device supports caching of globals in L1 cache, or 0 if it is not supported."]
7946 #[doc = " - \\ref ::cudaDeviceProp::localL1CacheSupported \"localL1CacheSupported\""]
7947 #[doc = " is 1 if the device supports caching of locals in L1 cache, or 0 if it is not supported."]
7948 #[doc = " - \\ref ::cudaDeviceProp::sharedMemPerMultiprocessor \"sharedMemPerMultiprocessor\" is the"]
7949 #[doc = " maximum amount of shared memory available to a multiprocessor in bytes; this amount is"]
7950 #[doc = " shared by all thread blocks simultaneously resident on a multiprocessor;"]
7951 #[doc = " - \\ref ::cudaDeviceProp::regsPerMultiprocessor \"regsPerMultiprocessor\" is the maximum number"]
7952 #[doc = " of 32-bit registers available to a multiprocessor; this number is shared"]
7953 #[doc = " by all thread blocks simultaneously resident on a multiprocessor;"]
7954 #[doc = " - \\ref ::cudaDeviceProp::managedMemory \"managedMemory\""]
7955 #[doc = " is 1 if the device supports allocating managed memory on this system, or 0 if it is not supported."]
7956 #[doc = " - \\ref ::cudaDeviceProp::isMultiGpuBoard \"isMultiGpuBoard\""]
7957 #[doc = " is 1 if the device is on a multi-GPU board (e.g. Gemini cards), and 0 if not;"]
7958 #[doc = " - \\ref ::cudaDeviceProp::multiGpuBoardGroupID \"multiGpuBoardGroupID\" is a unique identifier"]
7959 #[doc = " for a group of devices associated with the same board."]
7960 #[doc = " Devices on the same multi-GPU board will share the same identifier;"]
7961 #[doc = " - \\ref ::cudaDeviceProp::singleToDoublePrecisionPerfRatio \"singleToDoublePrecisionPerfRatio\""]
7962 #[doc = " is the ratio of single precision performance (in floating-point operations per second)"]
7963 #[doc = " to double precision performance."]
7964 #[doc = " - \\ref ::cudaDeviceProp::pageableMemoryAccess \"pageableMemoryAccess\" is 1 if the device supports"]
7965 #[doc = " coherently accessing pageable memory without calling cudaHostRegister on it, and 0 otherwise."]
7966 #[doc = " - \\ref ::cudaDeviceProp::concurrentManagedAccess \"concurrentManagedAccess\" is 1 if the device can"]
7967 #[doc = " coherently access managed memory concurrently with the CPU, and 0 otherwise."]
7968 #[doc = " - \\ref ::cudaDeviceProp::computePreemptionSupported \"computePreemptionSupported\" is 1 if the device"]
7969 #[doc = " supports Compute Preemption, and 0 otherwise."]
7970 #[doc = " - \\ref ::cudaDeviceProp::canUseHostPointerForRegisteredMem \"canUseHostPointerForRegisteredMem\" is 1 if"]
7971 #[doc = " the device can access host registered memory at the same virtual address as the CPU, and 0 otherwise."]
7972 #[doc = " - \\ref ::cudaDeviceProp::cooperativeLaunch \"cooperativeLaunch\" is 1 if the device supports launching"]
7973 #[doc = " cooperative kernels via ::cudaLaunchCooperativeKernel, and 0 otherwise."]
7974 #[doc = " - \\ref ::cudaDeviceProp::cooperativeMultiDeviceLaunch \"cooperativeMultiDeviceLaunch\" is 1 if the device"]
7975 #[doc = " supports launching cooperative kernels via ::cudaLaunchCooperativeKernelMultiDevice, and 0 otherwise."]
7976 #[doc = " - \\ref ::cudaDeviceProp::pageableMemoryAccessUsesHostPageTables \"pageableMemoryAccessUsesHostPageTables\" is 1 if the device accesses"]
7977 #[doc = " pageable memory via the host's page tables, and 0 otherwise."]
7978 #[doc = " - \\ref ::cudaDeviceProp::directManagedMemAccessFromHost \"directManagedMemAccessFromHost\" is 1 if the host can directly access managed"]
7979 #[doc = " memory on the device without migration, and 0 otherwise."]
7980 #[doc = " - \\ref ::cudaDeviceProp::maxBlocksPerMultiProcessor \"maxBlocksPerMultiProcessor\" is the maximum number of thread blocks"]
7981 #[doc = " that can reside on a multiprocessor."]
7982 #[doc = " - \\ref ::cudaDeviceProp::accessPolicyMaxWindowSize \"accessPolicyMaxWindowSize\" is"]
7983 #[doc = " the maximum value of ::cudaAccessPolicyWindow::num_bytes."]
7984 #[doc = ""]
7985 #[doc = " \\param prop - Properties for the specified device"]
7986 #[doc = " \\param device - Device number to get properties for"]
7987 #[doc = ""]
7988 #[doc = " \\return"]
7989 #[doc = " ::cudaSuccess,"]
7990 #[doc = " ::cudaErrorInvalidDevice"]
7991 #[doc = " \\notefnerr"]
7992 #[doc = " \\note_init_rt"]
7993 #[doc = " \\note_callback"]
7994 #[doc = ""]
7995 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaSetDevice, ::cudaChooseDevice,"]
7996 #[doc = " ::cudaDeviceGetAttribute,"]
7997 #[doc = " ::cuDeviceGetAttribute,"]
7998 #[doc = " ::cuDeviceGetName"]
7999 pub fn cudaGetDeviceProperties(prop: *mut cudaDeviceProp, device: ::libc::c_int)
8000 -> cudaError_t;
8001}
8002extern "C" {
8003 #[doc = " \\brief Returns information about the device"]
8004 #[doc = ""]
8005 #[doc = " Returns in \\p *value the integer value of the attribute \\p attr on device"]
8006 #[doc = " \\p device. The supported attributes are:"]
8007 #[doc = " - ::cudaDevAttrMaxThreadsPerBlock: Maximum number of threads per block;"]
8008 #[doc = " - ::cudaDevAttrMaxBlockDimX: Maximum x-dimension of a block;"]
8009 #[doc = " - ::cudaDevAttrMaxBlockDimY: Maximum y-dimension of a block;"]
8010 #[doc = " - ::cudaDevAttrMaxBlockDimZ: Maximum z-dimension of a block;"]
8011 #[doc = " - ::cudaDevAttrMaxGridDimX: Maximum x-dimension of a grid;"]
8012 #[doc = " - ::cudaDevAttrMaxGridDimY: Maximum y-dimension of a grid;"]
8013 #[doc = " - ::cudaDevAttrMaxGridDimZ: Maximum z-dimension of a grid;"]
8014 #[doc = " - ::cudaDevAttrMaxSharedMemoryPerBlock: Maximum amount of shared memory"]
8015 #[doc = " available to a thread block in bytes;"]
8016 #[doc = " - ::cudaDevAttrTotalConstantMemory: Memory available on device for"]
8017 #[doc = " __constant__ variables in a CUDA C kernel in bytes;"]
8018 #[doc = " - ::cudaDevAttrWarpSize: Warp size in threads;"]
8019 #[doc = " - ::cudaDevAttrMaxPitch: Maximum pitch in bytes allowed by the memory copy"]
8020 #[doc = " functions that involve memory regions allocated through ::cudaMallocPitch();"]
8021 #[doc = " - ::cudaDevAttrMaxTexture1DWidth: Maximum 1D texture width;"]
8022 #[doc = " - ::cudaDevAttrMaxTexture1DLinearWidth: Maximum width for a 1D texture bound"]
8023 #[doc = " to linear memory;"]
8024 #[doc = " - ::cudaDevAttrMaxTexture1DMipmappedWidth: Maximum mipmapped 1D texture width;"]
8025 #[doc = " - ::cudaDevAttrMaxTexture2DWidth: Maximum 2D texture width;"]
8026 #[doc = " - ::cudaDevAttrMaxTexture2DHeight: Maximum 2D texture height;"]
8027 #[doc = " - ::cudaDevAttrMaxTexture2DLinearWidth: Maximum width for a 2D texture"]
8028 #[doc = " bound to linear memory;"]
8029 #[doc = " - ::cudaDevAttrMaxTexture2DLinearHeight: Maximum height for a 2D texture"]
8030 #[doc = " bound to linear memory;"]
8031 #[doc = " - ::cudaDevAttrMaxTexture2DLinearPitch: Maximum pitch in bytes for a 2D"]
8032 #[doc = " texture bound to linear memory;"]
8033 #[doc = " - ::cudaDevAttrMaxTexture2DMipmappedWidth: Maximum mipmapped 2D texture"]
8034 #[doc = " width;"]
8035 #[doc = " - ::cudaDevAttrMaxTexture2DMipmappedHeight: Maximum mipmapped 2D texture"]
8036 #[doc = " height;"]
8037 #[doc = " - ::cudaDevAttrMaxTexture3DWidth: Maximum 3D texture width;"]
8038 #[doc = " - ::cudaDevAttrMaxTexture3DHeight: Maximum 3D texture height;"]
8039 #[doc = " - ::cudaDevAttrMaxTexture3DDepth: Maximum 3D texture depth;"]
8040 #[doc = " - ::cudaDevAttrMaxTexture3DWidthAlt: Alternate maximum 3D texture width,"]
8041 #[doc = " 0 if no alternate maximum 3D texture size is supported;"]
8042 #[doc = " - ::cudaDevAttrMaxTexture3DHeightAlt: Alternate maximum 3D texture height,"]
8043 #[doc = " 0 if no alternate maximum 3D texture size is supported;"]
8044 #[doc = " - ::cudaDevAttrMaxTexture3DDepthAlt: Alternate maximum 3D texture depth,"]
8045 #[doc = " 0 if no alternate maximum 3D texture size is supported;"]
8046 #[doc = " - ::cudaDevAttrMaxTextureCubemapWidth: Maximum cubemap texture width or"]
8047 #[doc = " height;"]
8048 #[doc = " - ::cudaDevAttrMaxTexture1DLayeredWidth: Maximum 1D layered texture width;"]
8049 #[doc = " - ::cudaDevAttrMaxTexture1DLayeredLayers: Maximum layers in a 1D layered"]
8050 #[doc = " texture;"]
8051 #[doc = " - ::cudaDevAttrMaxTexture2DLayeredWidth: Maximum 2D layered texture width;"]
8052 #[doc = " - ::cudaDevAttrMaxTexture2DLayeredHeight: Maximum 2D layered texture height;"]
8053 #[doc = " - ::cudaDevAttrMaxTexture2DLayeredLayers: Maximum layers in a 2D layered"]
8054 #[doc = " texture;"]
8055 #[doc = " - ::cudaDevAttrMaxTextureCubemapLayeredWidth: Maximum cubemap layered"]
8056 #[doc = " texture width or height;"]
8057 #[doc = " - ::cudaDevAttrMaxTextureCubemapLayeredLayers: Maximum layers in a cubemap"]
8058 #[doc = " layered texture;"]
8059 #[doc = " - ::cudaDevAttrMaxSurface1DWidth: Maximum 1D surface width;"]
8060 #[doc = " - ::cudaDevAttrMaxSurface2DWidth: Maximum 2D surface width;"]
8061 #[doc = " - ::cudaDevAttrMaxSurface2DHeight: Maximum 2D surface height;"]
8062 #[doc = " - ::cudaDevAttrMaxSurface3DWidth: Maximum 3D surface width;"]
8063 #[doc = " - ::cudaDevAttrMaxSurface3DHeight: Maximum 3D surface height;"]
8064 #[doc = " - ::cudaDevAttrMaxSurface3DDepth: Maximum 3D surface depth;"]
8065 #[doc = " - ::cudaDevAttrMaxSurface1DLayeredWidth: Maximum 1D layered surface width;"]
8066 #[doc = " - ::cudaDevAttrMaxSurface1DLayeredLayers: Maximum layers in a 1D layered"]
8067 #[doc = " surface;"]
8068 #[doc = " - ::cudaDevAttrMaxSurface2DLayeredWidth: Maximum 2D layered surface width;"]
8069 #[doc = " - ::cudaDevAttrMaxSurface2DLayeredHeight: Maximum 2D layered surface height;"]
8070 #[doc = " - ::cudaDevAttrMaxSurface2DLayeredLayers: Maximum layers in a 2D layered"]
8071 #[doc = " surface;"]
8072 #[doc = " - ::cudaDevAttrMaxSurfaceCubemapWidth: Maximum cubemap surface width;"]
8073 #[doc = " - ::cudaDevAttrMaxSurfaceCubemapLayeredWidth: Maximum cubemap layered"]
8074 #[doc = " surface width;"]
8075 #[doc = " - ::cudaDevAttrMaxSurfaceCubemapLayeredLayers: Maximum layers in a cubemap"]
8076 #[doc = " layered surface;"]
8077 #[doc = " - ::cudaDevAttrMaxRegistersPerBlock: Maximum number of 32-bit registers"]
8078 #[doc = " available to a thread block;"]
8079 #[doc = " - ::cudaDevAttrClockRate: Peak clock frequency in kilohertz;"]
8080 #[doc = " - ::cudaDevAttrTextureAlignment: Alignment requirement; texture base"]
8081 #[doc = " addresses aligned to ::textureAlign bytes do not need an offset applied"]
8082 #[doc = " to texture fetches;"]
8083 #[doc = " - ::cudaDevAttrTexturePitchAlignment: Pitch alignment requirement for 2D"]
8084 #[doc = " texture references bound to pitched memory;"]
8085 #[doc = " - ::cudaDevAttrGpuOverlap: 1 if the device can concurrently copy memory"]
8086 #[doc = " between host and device while executing a kernel, or 0 if not;"]
8087 #[doc = " - ::cudaDevAttrMultiProcessorCount: Number of multiprocessors on the device;"]
8088 #[doc = " - ::cudaDevAttrKernelExecTimeout: 1 if there is a run time limit for kernels"]
8089 #[doc = " executed on the device, or 0 if not;"]
8090 #[doc = " - ::cudaDevAttrIntegrated: 1 if the device is integrated with the memory"]
8091 #[doc = " subsystem, or 0 if not;"]
8092 #[doc = " - ::cudaDevAttrCanMapHostMemory: 1 if the device can map host memory into"]
8093 #[doc = " the CUDA address space, or 0 if not;"]
8094 #[doc = " - ::cudaDevAttrComputeMode: Compute mode is the compute mode that the device"]
8095 #[doc = " is currently in. Available modes are as follows:"]
8096 #[doc = " - ::cudaComputeModeDefault: Default mode - Device is not restricted and"]
8097 #[doc = " multiple threads can use ::cudaSetDevice() with this device."]
8098 #[doc = " - ::cudaComputeModeExclusive: Compute-exclusive mode - Only one thread will"]
8099 #[doc = " be able to use ::cudaSetDevice() with this device."]
8100 #[doc = " - ::cudaComputeModeProhibited: Compute-prohibited mode - No threads can use"]
8101 #[doc = " ::cudaSetDevice() with this device."]
8102 #[doc = " - ::cudaComputeModeExclusiveProcess: Compute-exclusive-process mode - Many"]
8103 #[doc = " threads in one process will be able to use ::cudaSetDevice() with this"]
8104 #[doc = " device."]
8105 #[doc = " - ::cudaDevAttrConcurrentKernels: 1 if the device supports executing"]
8106 #[doc = " multiple kernels within the same context simultaneously, or 0 if"]
8107 #[doc = " not. It is not guaranteed that multiple kernels will be resident on the"]
8108 #[doc = " device concurrently so this feature should not be relied upon for"]
8109 #[doc = " correctness;"]
8110 #[doc = " - ::cudaDevAttrEccEnabled: 1 if error correction is enabled on the device,"]
8111 #[doc = " 0 if error correction is disabled or not supported by the device;"]
8112 #[doc = " - ::cudaDevAttrPciBusId: PCI bus identifier of the device;"]
8113 #[doc = " - ::cudaDevAttrPciDeviceId: PCI device (also known as slot) identifier of"]
8114 #[doc = " the device;"]
8115 #[doc = " - ::cudaDevAttrTccDriver: 1 if the device is using a TCC driver. TCC is only"]
8116 #[doc = " available on Tesla hardware running Windows Vista or later;"]
8117 #[doc = " - ::cudaDevAttrMemoryClockRate: Peak memory clock frequency in kilohertz;"]
8118 #[doc = " - ::cudaDevAttrGlobalMemoryBusWidth: Global memory bus width in bits;"]
8119 #[doc = " - ::cudaDevAttrL2CacheSize: Size of L2 cache in bytes. 0 if the device"]
8120 #[doc = " doesn't have L2 cache;"]
8121 #[doc = " - ::cudaDevAttrMaxThreadsPerMultiProcessor: Maximum resident threads per"]
8122 #[doc = " multiprocessor;"]
8123 #[doc = " - ::cudaDevAttrUnifiedAddressing: 1 if the device shares a unified address"]
8124 #[doc = " space with the host, or 0 if not;"]
8125 #[doc = " - ::cudaDevAttrComputeCapabilityMajor: Major compute capability version"]
8126 #[doc = " number;"]
8127 #[doc = " - ::cudaDevAttrComputeCapabilityMinor: Minor compute capability version"]
8128 #[doc = " number;"]
8129 #[doc = " - ::cudaDevAttrStreamPrioritiesSupported: 1 if the device supports stream"]
8130 #[doc = " priorities, or 0 if not;"]
8131 #[doc = " - ::cudaDevAttrGlobalL1CacheSupported: 1 if device supports caching globals"]
8132 #[doc = " in L1 cache, 0 if not;"]
8133 #[doc = " - ::cudaDevAttrLocalL1CacheSupported: 1 if device supports caching locals"]
8134 #[doc = " in L1 cache, 0 if not;"]
8135 #[doc = " - ::cudaDevAttrMaxSharedMemoryPerMultiprocessor: Maximum amount of shared memory"]
8136 #[doc = " available to a multiprocessor in bytes; this amount is shared by all"]
8137 #[doc = " thread blocks simultaneously resident on a multiprocessor;"]
8138 #[doc = " - ::cudaDevAttrMaxRegistersPerMultiprocessor: Maximum number of 32-bit registers"]
8139 #[doc = " available to a multiprocessor; this number is shared by all thread blocks"]
8140 #[doc = " simultaneously resident on a multiprocessor;"]
8141 #[doc = " - ::cudaDevAttrManagedMemory: 1 if device supports allocating"]
8142 #[doc = " managed memory, 0 if not;"]
8143 #[doc = " - ::cudaDevAttrIsMultiGpuBoard: 1 if device is on a multi-GPU board, 0 if not;"]
8144 #[doc = " - ::cudaDevAttrMultiGpuBoardGroupID: Unique identifier for a group of devices on the"]
8145 #[doc = " same multi-GPU board;"]
8146 #[doc = " - ::cudaDevAttrHostNativeAtomicSupported: 1 if the link between the device and the"]
8147 #[doc = " host supports native atomic operations;"]
8148 #[doc = " - ::cudaDevAttrSingleToDoublePrecisionPerfRatio: Ratio of single precision performance"]
8149 #[doc = " (in floating-point operations per second) to double precision performance;"]
8150 #[doc = " - ::cudaDevAttrPageableMemoryAccess: 1 if the device supports coherently accessing"]
8151 #[doc = " pageable memory without calling cudaHostRegister on it, and 0 otherwise."]
8152 #[doc = " - ::cudaDevAttrConcurrentManagedAccess: 1 if the device can coherently access managed"]
8153 #[doc = " memory concurrently with the CPU, and 0 otherwise."]
8154 #[doc = " - ::cudaDevAttrComputePreemptionSupported: 1 if the device supports"]
8155 #[doc = " Compute Preemption, 0 if not."]
8156 #[doc = " - ::cudaDevAttrCanUseHostPointerForRegisteredMem: 1 if the device can access host"]
8157 #[doc = " registered memory at the same virtual address as the CPU, and 0 otherwise."]
8158 #[doc = " - ::cudaDevAttrCooperativeLaunch: 1 if the device supports launching cooperative kernels"]
8159 #[doc = " via ::cudaLaunchCooperativeKernel, and 0 otherwise."]
8160 #[doc = " - ::cudaDevAttrCooperativeMultiDeviceLaunch: 1 if the device supports launching cooperative"]
8161 #[doc = " kernels via ::cudaLaunchCooperativeKernelMultiDevice, and 0 otherwise."]
8162 #[doc = " - ::cudaDevAttrCanFlushRemoteWrites: 1 if the device supports flushing of outstanding"]
8163 #[doc = " remote writes, and 0 otherwise."]
8164 #[doc = " - ::cudaDevAttrHostRegisterSupported: 1 if the device supports host memory registration"]
8165 #[doc = " via ::cudaHostRegister, and 0 otherwise."]
8166 #[doc = " - ::cudaDevAttrPageableMemoryAccessUsesHostPageTables: 1 if the device accesses pageable memory via the"]
8167 #[doc = " host's page tables, and 0 otherwise."]
8168 #[doc = " - ::cudaDevAttrDirectManagedMemAccessFromHost: 1 if the host can directly access managed memory on the device"]
8169 #[doc = " without migration, and 0 otherwise."]
8170 #[doc = " - ::cudaDevAttrMaxSharedMemoryPerBlockOptin: Maximum per block shared memory size on the device. This value can"]
8171 #[doc = " be opted into when using ::cudaFuncSetAttribute"]
8172 #[doc = " - ::cudaDevAttrMaxBlocksPerMultiprocessor: Maximum number of thread blocks that can reside on a multiprocessor."]
8173 #[doc = " - ::cudaDevAttrMaxPersistingL2CacheSize: Maximum L2 persisting lines capacity setting in bytes."]
8174 #[doc = " - ::cudaDevAttrMaxAccessPolicyWindowSize: Maximum value of cudaAccessPolicyWindow::num_bytes."]
8175 #[doc = " - ::cudaDevAttrHostRegisterReadOnly: Device supports using the ::cudaHostRegister flag cudaHostRegisterReadOnly"]
8176 #[doc = " to register memory that must be mapped as read-only to the GPU"]
8177 #[doc = " - ::cudaDevAttrSparseCudaArraySupported: 1 if the device supports sparse CUDA arrays and sparse CUDA mipmapped arrays."]
8178 #[doc = ""]
8179 #[doc = " \\param value - Returned device attribute value"]
8180 #[doc = " \\param attr - Device attribute to query"]
8181 #[doc = " \\param device - Device number to query"]
8182 #[doc = ""]
8183 #[doc = " \\return"]
8184 #[doc = " ::cudaSuccess,"]
8185 #[doc = " ::cudaErrorInvalidDevice,"]
8186 #[doc = " ::cudaErrorInvalidValue"]
8187 #[doc = " \\notefnerr"]
8188 #[doc = " \\note_init_rt"]
8189 #[doc = " \\note_callback"]
8190 #[doc = ""]
8191 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaSetDevice, ::cudaChooseDevice,"]
8192 #[doc = " ::cudaGetDeviceProperties,"]
8193 #[doc = " ::cuDeviceGetAttribute"]
8194 pub fn cudaDeviceGetAttribute(
8195 value: *mut ::libc::c_int,
8196 attr: cudaDeviceAttr,
8197 device: ::libc::c_int,
8198 ) -> cudaError_t;
8199}
8200extern "C" {
8201 #[doc = " \\brief Returns the default mempool of a device"]
8202 #[doc = ""]
8203 #[doc = " The default mempool of a device contains device memory from that device."]
8204 #[doc = ""]
8205 #[doc = " \\return"]
8206 #[doc = " ::cudaSuccess,"]
8207 #[doc = " ::cudaErrorInvalidDevice,"]
8208 #[doc = " ::cudaErrorInvalidValue"]
8209 #[doc = " ::cudaErrorNotSupported"]
8210 #[doc = " \\notefnerr"]
8211 #[doc = " \\note_init_rt"]
8212 #[doc = " \\note_callback"]
8213 #[doc = ""]
8214 #[doc = " \\sa ::cuDeviceGetDefaultMemPool, ::cudaMallocAsync, ::cudaMemPoolTrimTo, ::cudaMemPoolGetAttribute, ::cudaDeviceSetMemPool, ::cudaMemPoolSetAttribute, ::cudaMemPoolSetAccess"]
8215 pub fn cudaDeviceGetDefaultMemPool(
8216 memPool: *mut cudaMemPool_t,
8217 device: ::libc::c_int,
8218 ) -> cudaError_t;
8219}
8220extern "C" {
8221 #[doc = " \\brief Sets the current memory pool of a device"]
8222 #[doc = ""]
8223 #[doc = " The memory pool must be local to the specified device."]
8224 #[doc = " Unless a mempool is specified in the ::cudaMallocAsync call,"]
8225 #[doc = " ::cudaMallocAsync allocates from the current mempool of the provided stream's device."]
8226 #[doc = " By default, a device's current memory pool is its default memory pool."]
8227 #[doc = ""]
8228 #[doc = " \\note Use ::cudaMallocFromPoolAsync to specify asynchronous allocations from a device different"]
8229 #[doc = " than the one the stream runs on."]
8230 #[doc = ""]
8231 #[doc = " \\returns"]
8232 #[doc = " ::cudaSuccess,"]
8233 #[doc = " ::cudaErrorInvalidValue"]
8234 #[doc = " ::cudaErrorInvalidDevice"]
8235 #[doc = " ::cudaErrorNotSupported"]
8236 #[doc = " \\notefnerr"]
8237 #[doc = " \\note_callback"]
8238 #[doc = ""]
8239 #[doc = " \\sa ::cuDeviceSetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaMemPoolCreate, ::cudaMemPoolDestroy, ::cudaMallocFromPoolAsync"]
8240 pub fn cudaDeviceSetMemPool(device: ::libc::c_int, memPool: cudaMemPool_t) -> cudaError_t;
8241}
8242extern "C" {
8243 #[doc = " \\brief Gets the current mempool for a device"]
8244 #[doc = ""]
8245 #[doc = " Returns the last pool provided to ::cudaDeviceSetMemPool for this device"]
8246 #[doc = " or the device's default memory pool if ::cudaDeviceSetMemPool has never been called."]
8247 #[doc = " By default the current mempool is the default mempool for a device,"]
8248 #[doc = " otherwise the returned pool must have been set with ::cuDeviceSetMemPool or ::cudaDeviceSetMemPool."]
8249 #[doc = ""]
8250 #[doc = " \\returns"]
8251 #[doc = " ::cudaSuccess,"]
8252 #[doc = " ::cudaErrorInvalidValue"]
8253 #[doc = " ::cudaErrorNotSupported"]
8254 #[doc = " \\notefnerr"]
8255 #[doc = " \\note_init_rt"]
8256 #[doc = " \\note_callback"]
8257 #[doc = ""]
8258 #[doc = " \\sa ::cuDeviceGetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceSetMemPool"]
8259 pub fn cudaDeviceGetMemPool(memPool: *mut cudaMemPool_t, device: ::libc::c_int) -> cudaError_t;
8260}
8261extern "C" {
8262 #[doc = " \\brief Return NvSciSync attributes that this device can support."]
8263 #[doc = ""]
8264 #[doc = " Returns in \\p nvSciSyncAttrList, the properties of NvSciSync that"]
8265 #[doc = " this CUDA device, \\p dev can support. The returned \\p nvSciSyncAttrList"]
8266 #[doc = " can be used to create an NvSciSync that matches this device's capabilities."]
8267 #[doc = ""]
8268 #[doc = " If NvSciSyncAttrKey_RequiredPerm field in \\p nvSciSyncAttrList is"]
8269 #[doc = " already set this API will return ::cudaErrorInvalidValue."]
8270 #[doc = ""]
8271 #[doc = " The applications should set \\p nvSciSyncAttrList to a valid"]
8272 #[doc = " NvSciSyncAttrList failing which this API will return"]
8273 #[doc = " ::cudaErrorInvalidHandle."]
8274 #[doc = ""]
8275 #[doc = " The \\p flags controls how applications intends to use"]
8276 #[doc = " the NvSciSync created from the \\p nvSciSyncAttrList. The valid flags are:"]
8277 #[doc = " - ::cudaNvSciSyncAttrSignal, specifies that the applications intends to"]
8278 #[doc = " signal an NvSciSync on this CUDA device."]
8279 #[doc = " - ::cudaNvSciSyncAttrWait, specifies that the applications intends to"]
8280 #[doc = " wait on an NvSciSync on this CUDA device."]
8281 #[doc = ""]
8282 #[doc = " At least one of these flags must be set, failing which the API"]
8283 #[doc = " returns ::cudaErrorInvalidValue. Both the flags are orthogonal"]
8284 #[doc = " to one another: a developer may set both these flags that allows to"]
8285 #[doc = " set both wait and signal specific attributes in the same \\p nvSciSyncAttrList."]
8286 #[doc = ""]
8287 #[doc = " \\param nvSciSyncAttrList - Return NvSciSync attributes supported."]
8288 #[doc = " \\param device - Valid Cuda Device to get NvSciSync attributes for."]
8289 #[doc = " \\param flags - flags describing NvSciSync usage."]
8290 #[doc = ""]
8291 #[doc = " \\return"]
8292 #[doc = ""]
8293 #[doc = " ::cudaSuccess,"]
8294 #[doc = " ::cudaErrorDeviceUninitialized,"]
8295 #[doc = " ::cudaErrorInvalidValue,"]
8296 #[doc = " ::cudaErrorInvalidHandle,"]
8297 #[doc = " ::cudaErrorInvalidDevice,"]
8298 #[doc = " ::cudaErrorNotSupported,"]
8299 #[doc = " ::cudaErrorMemoryAllocation"]
8300 #[doc = ""]
8301 #[doc = " \\sa"]
8302 #[doc = " ::cudaImportExternalSemaphore,"]
8303 #[doc = " ::cudaDestroyExternalSemaphore,"]
8304 #[doc = " ::cudaSignalExternalSemaphoresAsync,"]
8305 #[doc = " ::cudaWaitExternalSemaphoresAsync"]
8306 pub fn cudaDeviceGetNvSciSyncAttributes(
8307 nvSciSyncAttrList: *mut ::libc::c_void,
8308 device: ::libc::c_int,
8309 flags: ::libc::c_int,
8310 ) -> cudaError_t;
8311}
8312extern "C" {
8313 #[doc = " \\brief Queries attributes of the link between two devices."]
8314 #[doc = ""]
8315 #[doc = " Returns in \\p *value the value of the requested attribute \\p attrib of the"]
8316 #[doc = " link between \\p srcDevice and \\p dstDevice. The supported attributes are:"]
8317 #[doc = " - ::cudaDevP2PAttrPerformanceRank: A relative value indicating the"]
8318 #[doc = " performance of the link between two devices. Lower value means better"]
8319 #[doc = " performance (0 being the value used for most performant link)."]
8320 #[doc = " - ::cudaDevP2PAttrAccessSupported: 1 if peer access is enabled."]
8321 #[doc = " - ::cudaDevP2PAttrNativeAtomicSupported: 1 if native atomic operations over"]
8322 #[doc = " the link are supported."]
8323 #[doc = " - ::cudaDevP2PAttrCudaArrayAccessSupported: 1 if accessing CUDA arrays over"]
8324 #[doc = " the link is supported."]
8325 #[doc = ""]
8326 #[doc = " Returns ::cudaErrorInvalidDevice if \\p srcDevice or \\p dstDevice are not valid"]
8327 #[doc = " or if they represent the same device."]
8328 #[doc = ""]
8329 #[doc = " Returns ::cudaErrorInvalidValue if \\p attrib is not valid or if \\p value is"]
8330 #[doc = " a null pointer."]
8331 #[doc = ""]
8332 #[doc = " \\param value - Returned value of the requested attribute"]
8333 #[doc = " \\param attrib - The requested attribute of the link between \\p srcDevice and \\p dstDevice."]
8334 #[doc = " \\param srcDevice - The source device of the target link."]
8335 #[doc = " \\param dstDevice - The destination device of the target link."]
8336 #[doc = ""]
8337 #[doc = " \\return"]
8338 #[doc = " ::cudaSuccess,"]
8339 #[doc = " ::cudaErrorInvalidDevice,"]
8340 #[doc = " ::cudaErrorInvalidValue"]
8341 #[doc = " \\notefnerr"]
8342 #[doc = " \\note_init_rt"]
8343 #[doc = " \\note_callback"]
8344 #[doc = ""]
8345 #[doc = " \\sa ::cudaCtxEnablePeerAccess,"]
8346 #[doc = " ::cudaCtxDisablePeerAccess,"]
8347 #[doc = " ::cudaCtxCanAccessPeer,"]
8348 #[doc = " ::cuDeviceGetP2PAttribute"]
8349 pub fn cudaDeviceGetP2PAttribute(
8350 value: *mut ::libc::c_int,
8351 attr: cudaDeviceP2PAttr,
8352 srcDevice: ::libc::c_int,
8353 dstDevice: ::libc::c_int,
8354 ) -> cudaError_t;
8355}
8356extern "C" {
8357 #[doc = " \\brief Select compute-device which best matches criteria"]
8358 #[doc = ""]
8359 #[doc = " Returns in \\p *device the device which has properties that best match"]
8360 #[doc = " \\p *prop."]
8361 #[doc = ""]
8362 #[doc = " \\param device - Device with best match"]
8363 #[doc = " \\param prop - Desired device properties"]
8364 #[doc = ""]
8365 #[doc = " \\return"]
8366 #[doc = " ::cudaSuccess,"]
8367 #[doc = " ::cudaErrorInvalidValue"]
8368 #[doc = " \\notefnerr"]
8369 #[doc = " \\note_init_rt"]
8370 #[doc = " \\note_callback"]
8371 #[doc = ""]
8372 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaSetDevice,"]
8373 #[doc = " ::cudaGetDeviceProperties"]
8374 pub fn cudaChooseDevice(device: *mut ::libc::c_int, prop: *const cudaDeviceProp)
8375 -> cudaError_t;
8376}
8377extern "C" {
8378 #[doc = " \\brief Set device to be used for GPU executions"]
8379 #[doc = ""]
8380 #[doc = " Sets \\p device as the current device for the calling host thread."]
8381 #[doc = " Valid device id's are 0 to (::cudaGetDeviceCount() - 1)."]
8382 #[doc = ""]
8383 #[doc = " Any device memory subsequently allocated from this host thread"]
8384 #[doc = " using ::cudaMalloc(), ::cudaMallocPitch() or ::cudaMallocArray()"]
8385 #[doc = " will be physically resident on \\p device. Any host memory allocated"]
8386 #[doc = " from this host thread using ::cudaMallocHost() or ::cudaHostAlloc()"]
8387 #[doc = " or ::cudaHostRegister() will have its lifetime associated with"]
8388 #[doc = " \\p device. Any streams or events created from this host thread will"]
8389 #[doc = " be associated with \\p device. Any kernels launched from this host"]
8390 #[doc = " thread using the <<<>>> operator or ::cudaLaunchKernel() will be executed"]
8391 #[doc = " on \\p device."]
8392 #[doc = ""]
8393 #[doc = " This call may be made from any host thread, to any device, and at"]
8394 #[doc = " any time. This function will do no synchronization with the previous"]
8395 #[doc = " or new device, and should be considered a very low overhead call."]
8396 #[doc = ""]
8397 #[doc = " \\param device - Device on which the active host thread should execute the"]
8398 #[doc = " device code."]
8399 #[doc = ""]
8400 #[doc = " \\return"]
8401 #[doc = " ::cudaSuccess,"]
8402 #[doc = " ::cudaErrorInvalidDevice,"]
8403 #[doc = " ::cudaErrorDeviceAlreadyInUse"]
8404 #[doc = " \\notefnerr"]
8405 #[doc = " \\note_init_rt"]
8406 #[doc = " \\note_callback"]
8407 #[doc = ""]
8408 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaGetDeviceProperties,"]
8409 #[doc = " ::cudaChooseDevice,"]
8410 #[doc = " ::cuCtxSetCurrent"]
8411 pub fn cudaSetDevice(device: ::libc::c_int) -> cudaError_t;
8412}
8413extern "C" {
8414 #[doc = " \\brief Returns which device is currently being used"]
8415 #[doc = ""]
8416 #[doc = " Returns in \\p *device the current device for the calling host thread."]
8417 #[doc = ""]
8418 #[doc = " \\param device - Returns the device on which the active host thread"]
8419 #[doc = " executes the device code."]
8420 #[doc = ""]
8421 #[doc = " \\return"]
8422 #[doc = " ::cudaSuccess,"]
8423 #[doc = " ::cudaErrorInvalidValue"]
8424 #[doc = " \\notefnerr"]
8425 #[doc = " \\note_init_rt"]
8426 #[doc = " \\note_callback"]
8427 #[doc = ""]
8428 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaSetDevice, ::cudaGetDeviceProperties,"]
8429 #[doc = " ::cudaChooseDevice,"]
8430 #[doc = " ::cuCtxGetCurrent"]
8431 pub fn cudaGetDevice(device: *mut ::libc::c_int) -> cudaError_t;
8432}
8433extern "C" {
8434 #[doc = " \\brief Set a list of devices that can be used for CUDA"]
8435 #[doc = ""]
8436 #[doc = " Sets a list of devices for CUDA execution in priority order using"]
8437 #[doc = " \\p device_arr. The parameter \\p len specifies the number of elements in the"]
8438 #[doc = " list. CUDA will try devices from the list sequentially until it finds one"]
8439 #[doc = " that works. If this function is not called, or if it is called with a \\p len"]
8440 #[doc = " of 0, then CUDA will go back to its default behavior of trying devices"]
8441 #[doc = " sequentially from a default list containing all of the available CUDA"]
8442 #[doc = " devices in the system. If a specified device ID in the list does not exist,"]
8443 #[doc = " this function will return ::cudaErrorInvalidDevice. If \\p len is not 0 and"]
8444 #[doc = " \\p device_arr is NULL or if \\p len exceeds the number of devices in"]
8445 #[doc = " the system, then ::cudaErrorInvalidValue is returned."]
8446 #[doc = ""]
8447 #[doc = " \\param device_arr - List of devices to try"]
8448 #[doc = " \\param len - Number of devices in specified list"]
8449 #[doc = ""]
8450 #[doc = " \\return"]
8451 #[doc = " ::cudaSuccess,"]
8452 #[doc = " ::cudaErrorInvalidValue,"]
8453 #[doc = " ::cudaErrorInvalidDevice"]
8454 #[doc = " \\notefnerr"]
8455 #[doc = " \\note_init_rt"]
8456 #[doc = " \\note_callback"]
8457 #[doc = ""]
8458 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaSetDevice, ::cudaGetDeviceProperties,"]
8459 #[doc = " ::cudaSetDeviceFlags,"]
8460 #[doc = " ::cudaChooseDevice"]
8461 pub fn cudaSetValidDevices(device_arr: *mut ::libc::c_int, len: ::libc::c_int) -> cudaError_t;
8462}
8463extern "C" {
8464 #[doc = " \\brief Sets flags to be used for device executions"]
8465 #[doc = ""]
8466 #[doc = " Records \\p flags as the flags for the current device. If the current device"]
8467 #[doc = " has been set and that device has already been initialized, the previous flags"]
8468 #[doc = " are overwritten. If the current device has not been initialized, it is"]
8469 #[doc = " initialized with the provided flags. If no device has been made current to"]
8470 #[doc = " the calling thread, a default device is selected and initialized with the"]
8471 #[doc = " provided flags."]
8472 #[doc = ""]
8473 #[doc = " The two LSBs of the \\p flags parameter can be used to control how the CPU"]
8474 #[doc = " thread interacts with the OS scheduler when waiting for results from the"]
8475 #[doc = " device."]
8476 #[doc = ""]
8477 #[doc = " - ::cudaDeviceScheduleAuto: The default value if the \\p flags parameter is"]
8478 #[doc = " zero, uses a heuristic based on the number of active CUDA contexts in the"]
8479 #[doc = " process \\p C and the number of logical processors in the system \\p P. If"]
8480 #[doc = " \\p C \\> \\p P, then CUDA will yield to other OS threads when waiting for the"]
8481 #[doc = " device, otherwise CUDA will not yield while waiting for results and"]
8482 #[doc = " actively spin on the processor. Additionally, on Tegra devices,"]
8483 #[doc = " ::cudaDeviceScheduleAuto uses a heuristic based on the power profile of"]
8484 #[doc = " the platform and may choose ::cudaDeviceScheduleBlockingSync for low-powered"]
8485 #[doc = " devices."]
8486 #[doc = " - ::cudaDeviceScheduleSpin: Instruct CUDA to actively spin when waiting for"]
8487 #[doc = " results from the device. This can decrease latency when waiting for the"]
8488 #[doc = " device, but may lower the performance of CPU threads if they are performing"]
8489 #[doc = " work in parallel with the CUDA thread."]
8490 #[doc = " - ::cudaDeviceScheduleYield: Instruct CUDA to yield its thread when waiting"]
8491 #[doc = " for results from the device. This can increase latency when waiting for the"]
8492 #[doc = " device, but can increase the performance of CPU threads performing work in"]
8493 #[doc = " parallel with the device."]
8494 #[doc = " - ::cudaDeviceScheduleBlockingSync: Instruct CUDA to block the CPU thread"]
8495 #[doc = " on a synchronization primitive when waiting for the device to finish work."]
8496 #[doc = " - ::cudaDeviceBlockingSync: Instruct CUDA to block the CPU thread on a"]
8497 #[doc = " synchronization primitive when waiting for the device to finish work. <br>"]
8498 #[doc = " \\ref deprecated \"Deprecated:\" This flag was deprecated as of CUDA 4.0 and"]
8499 #[doc = " replaced with ::cudaDeviceScheduleBlockingSync."]
8500 #[doc = " - ::cudaDeviceMapHost: This flag enables allocating pinned"]
8501 #[doc = " host memory that is accessible to the device. It is implicit for the"]
8502 #[doc = " runtime but may be absent if a context is created using the driver API."]
8503 #[doc = " If this flag is not set, ::cudaHostGetDevicePointer() will always return"]
8504 #[doc = " a failure code."]
8505 #[doc = " - ::cudaDeviceLmemResizeToMax: Instruct CUDA to not reduce local memory"]
8506 #[doc = " after resizing local memory for a kernel. This can prevent thrashing by"]
8507 #[doc = " local memory allocations when launching many kernels with high local"]
8508 #[doc = " memory usage at the cost of potentially increased memory usage. <br>"]
8509 #[doc = " \\ref deprecated \"Deprecated:\" This flag is deprecated and the behavior enabled"]
8510 #[doc = " by this flag is now the default and cannot be disabled."]
8511 #[doc = ""]
8512 #[doc = " \\param flags - Parameters for device operation"]
8513 #[doc = ""]
8514 #[doc = " \\return"]
8515 #[doc = " ::cudaSuccess,"]
8516 #[doc = " ::cudaErrorInvalidValue,"]
8517 #[doc = " \\notefnerr"]
8518 #[doc = " \\note_init_rt"]
8519 #[doc = " \\note_callback"]
8520 #[doc = ""]
8521 #[doc = " \\sa ::cudaGetDeviceFlags, ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaGetDeviceProperties,"]
8522 #[doc = " ::cudaSetDevice, ::cudaSetValidDevices,"]
8523 #[doc = " ::cudaChooseDevice,"]
8524 #[doc = " ::cuDevicePrimaryCtxSetFlags"]
8525 pub fn cudaSetDeviceFlags(flags: ::libc::c_uint) -> cudaError_t;
8526}
8527extern "C" {
8528 #[doc = " \\brief Gets the flags for the current device"]
8529 #[doc = ""]
8530 #[doc = ""]
8531 #[doc = " Returns in \\p flags the flags for the current device. If there is a current"]
8532 #[doc = " device for the calling thread, the flags for the device are returned. If"]
8533 #[doc = " there is no current device, the flags for the first device are returned,"]
8534 #[doc = " which may be the default flags. Compare to the behavior of"]
8535 #[doc = " ::cudaSetDeviceFlags."]
8536 #[doc = ""]
8537 #[doc = " Typically, the flags returned should match the behavior that will be seen"]
8538 #[doc = " if the calling thread uses a device after this call, without any change to"]
8539 #[doc = " the flags or current device inbetween by this or another thread. Note that"]
8540 #[doc = " if the device is not initialized, it is possible for another thread to"]
8541 #[doc = " change the flags for the current device before it is initialized."]
8542 #[doc = " Additionally, when using exclusive mode, if this thread has not requested a"]
8543 #[doc = " specific device, it may use a device other than the first device, contrary"]
8544 #[doc = " to the assumption made by this function."]
8545 #[doc = ""]
8546 #[doc = " If a context has been created via the driver API and is current to the"]
8547 #[doc = " calling thread, the flags for that context are always returned."]
8548 #[doc = ""]
8549 #[doc = " Flags returned by this function may specifically include ::cudaDeviceMapHost"]
8550 #[doc = " even though it is not accepted by ::cudaSetDeviceFlags because it is"]
8551 #[doc = " implicit in runtime API flags. The reason for this is that the current"]
8552 #[doc = " context may have been created via the driver API in which case the flag is"]
8553 #[doc = " not implicit and may be unset."]
8554 #[doc = ""]
8555 #[doc = " \\param flags - Pointer to store the device flags"]
8556 #[doc = ""]
8557 #[doc = " \\return"]
8558 #[doc = " ::cudaSuccess,"]
8559 #[doc = " ::cudaErrorInvalidDevice"]
8560 #[doc = " \\notefnerr"]
8561 #[doc = " \\note_init_rt"]
8562 #[doc = " \\note_callback"]
8563 #[doc = ""]
8564 #[doc = " \\sa ::cudaGetDevice, ::cudaGetDeviceProperties,"]
8565 #[doc = " ::cudaSetDevice, ::cudaSetDeviceFlags,"]
8566 #[doc = " ::cuCtxGetFlags,"]
8567 #[doc = " ::cuDevicePrimaryCtxGetState"]
8568 pub fn cudaGetDeviceFlags(flags: *mut ::libc::c_uint) -> cudaError_t;
8569}
8570extern "C" {
8571 #[doc = " \\brief Create an asynchronous stream"]
8572 #[doc = ""]
8573 #[doc = " Creates a new asynchronous stream."]
8574 #[doc = ""]
8575 #[doc = " \\param pStream - Pointer to new stream identifier"]
8576 #[doc = ""]
8577 #[doc = " \\return"]
8578 #[doc = " ::cudaSuccess,"]
8579 #[doc = " ::cudaErrorInvalidValue"]
8580 #[doc = " \\notefnerr"]
8581 #[doc = " \\note_init_rt"]
8582 #[doc = " \\note_callback"]
8583 #[doc = ""]
8584 #[doc = " \\sa ::cudaStreamCreateWithPriority,"]
8585 #[doc = " ::cudaStreamCreateWithFlags,"]
8586 #[doc = " ::cudaStreamGetPriority,"]
8587 #[doc = " ::cudaStreamGetFlags,"]
8588 #[doc = " ::cudaStreamQuery,"]
8589 #[doc = " ::cudaStreamSynchronize,"]
8590 #[doc = " ::cudaStreamWaitEvent,"]
8591 #[doc = " ::cudaStreamAddCallback,"]
8592 #[doc = " ::cudaStreamDestroy,"]
8593 #[doc = " ::cuStreamCreate"]
8594 pub fn cudaStreamCreate(pStream: *mut cudaStream_t) -> cudaError_t;
8595}
8596extern "C" {
8597 #[doc = " \\brief Create an asynchronous stream"]
8598 #[doc = ""]
8599 #[doc = " Creates a new asynchronous stream. The \\p flags argument determines the"]
8600 #[doc = " behaviors of the stream. Valid values for \\p flags are"]
8601 #[doc = " - ::cudaStreamDefault: Default stream creation flag."]
8602 #[doc = " - ::cudaStreamNonBlocking: Specifies that work running in the created"]
8603 #[doc = " stream may run concurrently with work in stream 0 (the NULL stream), and that"]
8604 #[doc = " the created stream should perform no implicit synchronization with stream 0."]
8605 #[doc = ""]
8606 #[doc = " \\param pStream - Pointer to new stream identifier"]
8607 #[doc = " \\param flags - Parameters for stream creation"]
8608 #[doc = ""]
8609 #[doc = " \\return"]
8610 #[doc = " ::cudaSuccess,"]
8611 #[doc = " ::cudaErrorInvalidValue"]
8612 #[doc = " \\notefnerr"]
8613 #[doc = " \\note_init_rt"]
8614 #[doc = " \\note_callback"]
8615 #[doc = ""]
8616 #[doc = " \\sa ::cudaStreamCreate,"]
8617 #[doc = " ::cudaStreamCreateWithPriority,"]
8618 #[doc = " ::cudaStreamGetFlags,"]
8619 #[doc = " ::cudaStreamQuery,"]
8620 #[doc = " ::cudaStreamSynchronize,"]
8621 #[doc = " ::cudaStreamWaitEvent,"]
8622 #[doc = " ::cudaStreamAddCallback,"]
8623 #[doc = " ::cudaStreamDestroy,"]
8624 #[doc = " ::cuStreamCreate"]
8625 pub fn cudaStreamCreateWithFlags(
8626 pStream: *mut cudaStream_t,
8627 flags: ::libc::c_uint,
8628 ) -> cudaError_t;
8629}
8630extern "C" {
8631 #[doc = " \\brief Create an asynchronous stream with the specified priority"]
8632 #[doc = ""]
8633 #[doc = " Creates a stream with the specified priority and returns a handle in \\p pStream."]
8634 #[doc = " This API alters the scheduler priority of work in the stream. Work in a higher"]
8635 #[doc = " priority stream may preempt work already executing in a low priority stream."]
8636 #[doc = ""]
8637 #[doc = " \\p priority follows a convention where lower numbers represent higher priorities."]
8638 #[doc = " '0' represents default priority. The range of meaningful numerical priorities can"]
8639 #[doc = " be queried using ::cudaDeviceGetStreamPriorityRange. If the specified priority is"]
8640 #[doc = " outside the numerical range returned by ::cudaDeviceGetStreamPriorityRange,"]
8641 #[doc = " it will automatically be clamped to the lowest or the highest number in the range."]
8642 #[doc = ""]
8643 #[doc = " \\param pStream - Pointer to new stream identifier"]
8644 #[doc = " \\param flags - Flags for stream creation. See ::cudaStreamCreateWithFlags for a list of valid flags that can be passed"]
8645 #[doc = " \\param priority - Priority of the stream. Lower numbers represent higher priorities."]
8646 #[doc = " See ::cudaDeviceGetStreamPriorityRange for more information about"]
8647 #[doc = " the meaningful stream priorities that can be passed."]
8648 #[doc = ""]
8649 #[doc = " \\return"]
8650 #[doc = " ::cudaSuccess,"]
8651 #[doc = " ::cudaErrorInvalidValue"]
8652 #[doc = " \\notefnerr"]
8653 #[doc = " \\note_init_rt"]
8654 #[doc = " \\note_callback"]
8655 #[doc = ""]
8656 #[doc = " \\note Stream priorities are supported only on GPUs"]
8657 #[doc = " with compute capability 3.5 or higher."]
8658 #[doc = ""]
8659 #[doc = " \\note In the current implementation, only compute kernels launched in"]
8660 #[doc = " priority streams are affected by the stream's priority. Stream priorities have"]
8661 #[doc = " no effect on host-to-device and device-to-host memory operations."]
8662 #[doc = ""]
8663 #[doc = " \\sa ::cudaStreamCreate,"]
8664 #[doc = " ::cudaStreamCreateWithFlags,"]
8665 #[doc = " ::cudaDeviceGetStreamPriorityRange,"]
8666 #[doc = " ::cudaStreamGetPriority,"]
8667 #[doc = " ::cudaStreamQuery,"]
8668 #[doc = " ::cudaStreamWaitEvent,"]
8669 #[doc = " ::cudaStreamAddCallback,"]
8670 #[doc = " ::cudaStreamSynchronize,"]
8671 #[doc = " ::cudaStreamDestroy,"]
8672 #[doc = " ::cuStreamCreateWithPriority"]
8673 pub fn cudaStreamCreateWithPriority(
8674 pStream: *mut cudaStream_t,
8675 flags: ::libc::c_uint,
8676 priority: ::libc::c_int,
8677 ) -> cudaError_t;
8678}
8679extern "C" {
8680 #[doc = " \\brief Query the priority of a stream"]
8681 #[doc = ""]
8682 #[doc = " Query the priority of a stream. The priority is returned in in \\p priority."]
8683 #[doc = " Note that if the stream was created with a priority outside the meaningful"]
8684 #[doc = " numerical range returned by ::cudaDeviceGetStreamPriorityRange,"]
8685 #[doc = " this function returns the clamped priority."]
8686 #[doc = " See ::cudaStreamCreateWithPriority for details about priority clamping."]
8687 #[doc = ""]
8688 #[doc = " \\param hStream - Handle to the stream to be queried"]
8689 #[doc = " \\param priority - Pointer to a signed integer in which the stream's priority is returned"]
8690 #[doc = ""]
8691 #[doc = " \\return"]
8692 #[doc = " ::cudaSuccess,"]
8693 #[doc = " ::cudaErrorInvalidValue,"]
8694 #[doc = " ::cudaErrorInvalidResourceHandle"]
8695 #[doc = " \\notefnerr"]
8696 #[doc = " \\note_init_rt"]
8697 #[doc = " \\note_callback"]
8698 #[doc = ""]
8699 #[doc = " \\sa ::cudaStreamCreateWithPriority,"]
8700 #[doc = " ::cudaDeviceGetStreamPriorityRange,"]
8701 #[doc = " ::cudaStreamGetFlags,"]
8702 #[doc = " ::cuStreamGetPriority"]
8703 pub fn cudaStreamGetPriority(
8704 hStream: cudaStream_t,
8705 priority: *mut ::libc::c_int,
8706 ) -> cudaError_t;
8707}
8708extern "C" {
8709 #[doc = " \\brief Query the flags of a stream"]
8710 #[doc = ""]
8711 #[doc = " Query the flags of a stream. The flags are returned in \\p flags."]
8712 #[doc = " See ::cudaStreamCreateWithFlags for a list of valid flags."]
8713 #[doc = ""]
8714 #[doc = " \\param hStream - Handle to the stream to be queried"]
8715 #[doc = " \\param flags - Pointer to an unsigned integer in which the stream's flags are returned"]
8716 #[doc = ""]
8717 #[doc = " \\return"]
8718 #[doc = " ::cudaSuccess,"]
8719 #[doc = " ::cudaErrorInvalidValue,"]
8720 #[doc = " ::cudaErrorInvalidResourceHandle"]
8721 #[doc = " \\note_null_stream"]
8722 #[doc = " \\notefnerr"]
8723 #[doc = " \\note_init_rt"]
8724 #[doc = " \\note_callback"]
8725 #[doc = ""]
8726 #[doc = " \\sa ::cudaStreamCreateWithPriority,"]
8727 #[doc = " ::cudaStreamCreateWithFlags,"]
8728 #[doc = " ::cudaStreamGetPriority,"]
8729 #[doc = " ::cuStreamGetFlags"]
8730 pub fn cudaStreamGetFlags(hStream: cudaStream_t, flags: *mut ::libc::c_uint) -> cudaError_t;
8731}
8732extern "C" {
8733 #[doc = " \\brief Resets all persisting lines in cache to normal status."]
8734 #[doc = ""]
8735 #[doc = " Resets all persisting lines in cache to normal status."]
8736 #[doc = " Takes effect on function return."]
8737 #[doc = ""]
8738 #[doc = " \\return"]
8739 #[doc = " ::cudaSuccess,"]
8740 #[doc = " \\notefnerr"]
8741 #[doc = ""]
8742 #[doc = " \\sa"]
8743 #[doc = " ::cudaAccessPolicyWindow"]
8744 pub fn cudaCtxResetPersistingL2Cache() -> cudaError_t;
8745}
8746extern "C" {
8747 #[doc = " \\brief Copies attributes from source stream to destination stream."]
8748 #[doc = ""]
8749 #[doc = " Copies attributes from source stream \\p src to destination stream \\p dst."]
8750 #[doc = " Both streams must have the same context."]
8751 #[doc = ""]
8752 #[doc = " \\param[out] dst Destination stream"]
8753 #[doc = " \\param[in] src Source stream"]
8754 #[doc = " For attributes see ::cudaStreamAttrID"]
8755 #[doc = ""]
8756 #[doc = " \\return"]
8757 #[doc = " ::cudaSuccess,"]
8758 #[doc = " ::cudaErrorNotSupported"]
8759 #[doc = " \\notefnerr"]
8760 #[doc = ""]
8761 #[doc = " \\sa"]
8762 #[doc = " ::cudaAccessPolicyWindow"]
8763 pub fn cudaStreamCopyAttributes(dst: cudaStream_t, src: cudaStream_t) -> cudaError_t;
8764}
8765extern "C" {
8766 #[doc = " \\brief Queries stream attribute."]
8767 #[doc = ""]
8768 #[doc = " Queries attribute \\p attr from \\p hStream and stores it in corresponding"]
8769 #[doc = " member of \\p value_out."]
8770 #[doc = ""]
8771 #[doc = " \\param[in] hStream"]
8772 #[doc = " \\param[in] attr"]
8773 #[doc = " \\param[out] value_out"]
8774 #[doc = ""]
8775 #[doc = " \\return"]
8776 #[doc = " ::cudaSuccess,"]
8777 #[doc = " ::cudaErrorInvalidValue,"]
8778 #[doc = " ::cudaErrorInvalidResourceHandle"]
8779 #[doc = " \\notefnerr"]
8780 #[doc = ""]
8781 #[doc = " \\sa"]
8782 #[doc = " ::cudaAccessPolicyWindow"]
8783 pub fn cudaStreamGetAttribute(
8784 hStream: cudaStream_t,
8785 attr: cudaStreamAttrID,
8786 value_out: *mut cudaStreamAttrValue,
8787 ) -> cudaError_t;
8788}
8789extern "C" {
8790 #[doc = " \\brief Sets stream attribute."]
8791 #[doc = ""]
8792 #[doc = " Sets attribute \\p attr on \\p hStream from corresponding attribute of"]
8793 #[doc = " \\p value. The updated attribute will be applied to subsequent work"]
8794 #[doc = " submitted to the stream. It will not affect previously submitted work."]
8795 #[doc = ""]
8796 #[doc = " \\param[out] hStream"]
8797 #[doc = " \\param[in] attr"]
8798 #[doc = " \\param[in] value"]
8799 #[doc = ""]
8800 #[doc = " \\return"]
8801 #[doc = " ::cudaSuccess,"]
8802 #[doc = " ::cudaErrorInvalidValue,"]
8803 #[doc = " ::cudaErrorInvalidResourceHandle"]
8804 #[doc = " \\notefnerr"]
8805 #[doc = ""]
8806 #[doc = " \\sa"]
8807 #[doc = " ::cudaAccessPolicyWindow"]
8808 pub fn cudaStreamSetAttribute(
8809 hStream: cudaStream_t,
8810 attr: cudaStreamAttrID,
8811 value: *const cudaStreamAttrValue,
8812 ) -> cudaError_t;
8813}
8814extern "C" {
8815 #[doc = " \\brief Destroys and cleans up an asynchronous stream"]
8816 #[doc = ""]
8817 #[doc = " Destroys and cleans up the asynchronous stream specified by \\p stream."]
8818 #[doc = ""]
8819 #[doc = " In case the device is still doing work in the stream \\p stream"]
8820 #[doc = " when ::cudaStreamDestroy() is called, the function will return immediately"]
8821 #[doc = " and the resources associated with \\p stream will be released automatically"]
8822 #[doc = " once the device has completed all work in \\p stream."]
8823 #[doc = ""]
8824 #[doc = " \\param stream - Stream identifier"]
8825 #[doc = ""]
8826 #[doc = " \\return"]
8827 #[doc = " ::cudaSuccess,"]
8828 #[doc = " ::cudaErrorInvalidValue,"]
8829 #[doc = " ::cudaErrorInvalidResourceHandle"]
8830 #[doc = " \\note_null_stream"]
8831 #[doc = " \\notefnerr"]
8832 #[doc = " \\note_init_rt"]
8833 #[doc = " \\note_callback"]
8834 #[doc = " \\note_destroy_ub"]
8835 #[doc = ""]
8836 #[doc = " \\sa ::cudaStreamCreate,"]
8837 #[doc = " ::cudaStreamCreateWithFlags,"]
8838 #[doc = " ::cudaStreamQuery,"]
8839 #[doc = " ::cudaStreamWaitEvent,"]
8840 #[doc = " ::cudaStreamSynchronize,"]
8841 #[doc = " ::cudaStreamAddCallback,"]
8842 #[doc = " ::cuStreamDestroy"]
8843 pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t;
8844}
8845extern "C" {
8846 #[doc = " \\brief Make a compute stream wait on an event"]
8847 #[doc = ""]
8848 #[doc = " Makes all future work submitted to \\p stream wait for all work captured in"]
8849 #[doc = " \\p event. See ::cudaEventRecord() for details on what is captured by an event."]
8850 #[doc = " The synchronization will be performed efficiently on the device when applicable."]
8851 #[doc = " \\p event may be from a different device than \\p stream."]
8852 #[doc = ""]
8853 #[doc = " flags include:"]
8854 #[doc = " - ::cudaEventWaitDefault: Default event creation flag."]
8855 #[doc = " - ::cudaEventWaitExternal: Event is captured in the graph as an external"]
8856 #[doc = " event node when performing stream capture."]
8857 #[doc = ""]
8858 #[doc = " \\param stream - Stream to wait"]
8859 #[doc = " \\param event - Event to wait on"]
8860 #[doc = " \\param flags - Parameters for the operation(See above)"]
8861 #[doc = ""]
8862 #[doc = " \\return"]
8863 #[doc = " ::cudaSuccess,"]
8864 #[doc = " ::cudaErrorInvalidValue,"]
8865 #[doc = " ::cudaErrorInvalidResourceHandle"]
8866 #[doc = " \\note_null_stream"]
8867 #[doc = " \\notefnerr"]
8868 #[doc = " \\note_init_rt"]
8869 #[doc = " \\note_callback"]
8870 #[doc = ""]
8871 #[doc = " \\sa ::cudaStreamCreate, ::cudaStreamCreateWithFlags, ::cudaStreamQuery, ::cudaStreamSynchronize, ::cudaStreamAddCallback, ::cudaStreamDestroy,"]
8872 #[doc = " ::cuStreamWaitEvent"]
8873 pub fn cudaStreamWaitEvent(
8874 stream: cudaStream_t,
8875 event: cudaEvent_t,
8876 flags: ::libc::c_uint,
8877 ) -> cudaError_t;
8878}
8879#[doc = " Type of stream callback functions."]
8880#[doc = " \\param stream The stream as passed to ::cudaStreamAddCallback, may be NULL."]
8881#[doc = " \\param status ::cudaSuccess or any persistent error on the stream."]
8882#[doc = " \\param userData User parameter provided at registration."]
8883pub type cudaStreamCallback_t = ::std::option::Option<
8884 unsafe extern "C" fn(stream: cudaStream_t, status: cudaError_t, userData: *mut ::libc::c_void),
8885>;
8886extern "C" {
8887 #[doc = " \\brief Add a callback to a compute stream"]
8888 #[doc = ""]
8889 #[doc = " \\note This function is slated for eventual deprecation and removal. If"]
8890 #[doc = " you do not require the callback to execute in case of a device error,"]
8891 #[doc = " consider using ::cudaLaunchHostFunc. Additionally, this function is not"]
8892 #[doc = " supported with ::cudaStreamBeginCapture and ::cudaStreamEndCapture, unlike"]
8893 #[doc = " ::cudaLaunchHostFunc."]
8894 #[doc = ""]
8895 #[doc = " Adds a callback to be called on the host after all currently enqueued"]
8896 #[doc = " items in the stream have completed. For each"]
8897 #[doc = " cudaStreamAddCallback call, a callback will be executed exactly once."]
8898 #[doc = " The callback will block later work in the stream until it is finished."]
8899 #[doc = ""]
8900 #[doc = " The callback may be passed ::cudaSuccess or an error code. In the event"]
8901 #[doc = " of a device error, all subsequently executed callbacks will receive an"]
8902 #[doc = " appropriate ::cudaError_t."]
8903 #[doc = ""]
8904 #[doc = " Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs"]
8905 #[doc = " may result in ::cudaErrorNotPermitted. Callbacks must not perform any"]
8906 #[doc = " synchronization that may depend on outstanding device work or other callbacks"]
8907 #[doc = " that are not mandated to run earlier. Callbacks without a mandated order"]
8908 #[doc = " (in independent streams) execute in undefined order and may be serialized."]
8909 #[doc = ""]
8910 #[doc = " For the purposes of Unified Memory, callback execution makes a number of"]
8911 #[doc = " guarantees:"]
8912 #[doc = " <ul>"]
8913 #[doc = " <li>The callback stream is considered idle for the duration of the"]
8914 #[doc = " callback. Thus, for example, a callback may always use memory attached"]
8915 #[doc = " to the callback stream.</li>"]
8916 #[doc = " <li>The start of execution of a callback has the same effect as"]
8917 #[doc = " synchronizing an event recorded in the same stream immediately prior to"]
8918 #[doc = " the callback. It thus synchronizes streams which have been \"joined\""]
8919 #[doc = " prior to the callback.</li>"]
8920 #[doc = " <li>Adding device work to any stream does not have the effect of making"]
8921 #[doc = " the stream active until all preceding callbacks have executed. Thus, for"]
8922 #[doc = " example, a callback might use global attached memory even if work has"]
8923 #[doc = " been added to another stream, if it has been properly ordered with an"]
8924 #[doc = " event.</li>"]
8925 #[doc = " <li>Completion of a callback does not cause a stream to become"]
8926 #[doc = " active except as described above. The callback stream will remain idle"]
8927 #[doc = " if no device work follows the callback, and will remain idle across"]
8928 #[doc = " consecutive callbacks without device work in between. Thus, for example,"]
8929 #[doc = " stream synchronization can be done by signaling from a callback at the"]
8930 #[doc = " end of the stream.</li>"]
8931 #[doc = " </ul>"]
8932 #[doc = ""]
8933 #[doc = " \\param stream - Stream to add callback to"]
8934 #[doc = " \\param callback - The function to call once preceding stream operations are complete"]
8935 #[doc = " \\param userData - User specified data to be passed to the callback function"]
8936 #[doc = " \\param flags - Reserved for future use, must be 0"]
8937 #[doc = ""]
8938 #[doc = " \\return"]
8939 #[doc = " ::cudaSuccess,"]
8940 #[doc = " ::cudaErrorInvalidResourceHandle,"]
8941 #[doc = " ::cudaErrorInvalidValue,"]
8942 #[doc = " ::cudaErrorNotSupported"]
8943 #[doc = " \\note_null_stream"]
8944 #[doc = " \\notefnerr"]
8945 #[doc = " \\note_init_rt"]
8946 #[doc = " \\note_callback"]
8947 #[doc = ""]
8948 #[doc = " \\sa ::cudaStreamCreate, ::cudaStreamCreateWithFlags, ::cudaStreamQuery, ::cudaStreamSynchronize, ::cudaStreamWaitEvent, ::cudaStreamDestroy, ::cudaMallocManaged, ::cudaStreamAttachMemAsync,"]
8949 #[doc = " ::cudaLaunchHostFunc, ::cuStreamAddCallback"]
8950 pub fn cudaStreamAddCallback(
8951 stream: cudaStream_t,
8952 callback: cudaStreamCallback_t,
8953 userData: *mut ::libc::c_void,
8954 flags: ::libc::c_uint,
8955 ) -> cudaError_t;
8956}
8957extern "C" {
8958 #[doc = " \\brief Waits for stream tasks to complete"]
8959 #[doc = ""]
8960 #[doc = " Blocks until \\p stream has completed all operations. If the"]
8961 #[doc = " ::cudaDeviceScheduleBlockingSync flag was set for this device,"]
8962 #[doc = " the host thread will block until the stream is finished with"]
8963 #[doc = " all of its tasks."]
8964 #[doc = ""]
8965 #[doc = " \\param stream - Stream identifier"]
8966 #[doc = ""]
8967 #[doc = " \\return"]
8968 #[doc = " ::cudaSuccess,"]
8969 #[doc = " ::cudaErrorInvalidResourceHandle"]
8970 #[doc = " \\note_null_stream"]
8971 #[doc = " \\notefnerr"]
8972 #[doc = " \\note_init_rt"]
8973 #[doc = " \\note_callback"]
8974 #[doc = ""]
8975 #[doc = " \\sa ::cudaStreamCreate, ::cudaStreamCreateWithFlags, ::cudaStreamQuery, ::cudaStreamWaitEvent, ::cudaStreamAddCallback, ::cudaStreamDestroy,"]
8976 #[doc = " ::cuStreamSynchronize"]
8977 pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
8978}
8979extern "C" {
8980 #[doc = " \\brief Queries an asynchronous stream for completion status"]
8981 #[doc = ""]
8982 #[doc = " Returns ::cudaSuccess if all operations in \\p stream have"]
8983 #[doc = " completed, or ::cudaErrorNotReady if not."]
8984 #[doc = ""]
8985 #[doc = " For the purposes of Unified Memory, a return value of ::cudaSuccess"]
8986 #[doc = " is equivalent to having called ::cudaStreamSynchronize()."]
8987 #[doc = ""]
8988 #[doc = " \\param stream - Stream identifier"]
8989 #[doc = ""]
8990 #[doc = " \\return"]
8991 #[doc = " ::cudaSuccess,"]
8992 #[doc = " ::cudaErrorNotReady,"]
8993 #[doc = " ::cudaErrorInvalidResourceHandle"]
8994 #[doc = " \\note_null_stream"]
8995 #[doc = " \\notefnerr"]
8996 #[doc = " \\note_init_rt"]
8997 #[doc = " \\note_callback"]
8998 #[doc = ""]
8999 #[doc = " \\sa ::cudaStreamCreate, ::cudaStreamCreateWithFlags, ::cudaStreamWaitEvent, ::cudaStreamSynchronize, ::cudaStreamAddCallback, ::cudaStreamDestroy,"]
9000 #[doc = " ::cuStreamQuery"]
9001 pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
9002}
9003extern "C" {
9004 pub fn cudaStreamAttachMemAsync(
9005 stream: cudaStream_t,
9006 devPtr: *mut ::libc::c_void,
9007 length: usize,
9008 flags: ::libc::c_uint,
9009 ) -> cudaError_t;
9010}
9011extern "C" {
9012 #[doc = " \\brief Begins graph capture on a stream"]
9013 #[doc = ""]
9014 #[doc = " Begin graph capture on \\p stream. When a stream is in capture mode, all operations"]
9015 #[doc = " pushed into the stream will not be executed, but will instead be captured into"]
9016 #[doc = " a graph, which will be returned via ::cudaStreamEndCapture. Capture may not be initiated"]
9017 #[doc = " if \\p stream is ::cudaStreamLegacy. Capture must be ended on the same stream in which"]
9018 #[doc = " it was initiated, and it may only be initiated if the stream is not already in capture"]
9019 #[doc = " mode. The capture mode may be queried via ::cudaStreamIsCapturing. A unique id"]
9020 #[doc = " representing the capture sequence may be queried via ::cudaStreamGetCaptureInfo."]
9021 #[doc = ""]
9022 #[doc = " If \\p mode is not ::cudaStreamCaptureModeRelaxed, ::cudaStreamEndCapture must be"]
9023 #[doc = " called on this stream from the same thread."]
9024 #[doc = ""]
9025 #[doc = " \\note Kernels captured using this API must not use texture and surface references."]
9026 #[doc = " Reading or writing through any texture or surface reference is undefined"]
9027 #[doc = " behavior. This restriction does not apply to texture and surface objects."]
9028 #[doc = ""]
9029 #[doc = " \\param stream - Stream in which to initiate capture"]
9030 #[doc = " \\param mode - Controls the interaction of this capture sequence with other API"]
9031 #[doc = " calls that are potentially unsafe. For more details see"]
9032 #[doc = " ::cudaThreadExchangeStreamCaptureMode."]
9033 #[doc = ""]
9034 #[doc = " \\return"]
9035 #[doc = " ::cudaSuccess,"]
9036 #[doc = " ::cudaErrorInvalidValue"]
9037 #[doc = " \\notefnerr"]
9038 #[doc = ""]
9039 #[doc = " \\sa"]
9040 #[doc = " ::cudaStreamCreate,"]
9041 #[doc = " ::cudaStreamIsCapturing,"]
9042 #[doc = " ::cudaStreamEndCapture,"]
9043 #[doc = " ::cudaThreadExchangeStreamCaptureMode"]
9044 pub fn cudaStreamBeginCapture(stream: cudaStream_t, mode: cudaStreamCaptureMode)
9045 -> cudaError_t;
9046}
9047extern "C" {
9048 #[doc = " \\brief Swaps the stream capture interaction mode for a thread"]
9049 #[doc = ""]
9050 #[doc = " Sets the calling thread's stream capture interaction mode to the value contained"]
9051 #[doc = " in \\p *mode, and overwrites \\p *mode with the previous mode for the thread. To"]
9052 #[doc = " facilitate deterministic behavior across function or module boundaries, callers"]
9053 #[doc = " are encouraged to use this API in a push-pop fashion: \\code"]
9054 #[doc = "cudaStreamCaptureMode mode = desiredMode;"]
9055 #[doc = "cudaThreadExchangeStreamCaptureMode(&mode);"]
9056 #[doc = "..."]
9057 #[doc = "cudaThreadExchangeStreamCaptureMode(&mode); // restore previous mode"]
9058 #[doc = " \\endcode"]
9059 #[doc = ""]
9060 #[doc = " During stream capture (see ::cudaStreamBeginCapture), some actions, such as a call"]
9061 #[doc = " to ::cudaMalloc, may be unsafe. In the case of ::cudaMalloc, the operation is"]
9062 #[doc = " not enqueued asynchronously to a stream, and is not observed by stream capture."]
9063 #[doc = " Therefore, if the sequence of operations captured via ::cudaStreamBeginCapture"]
9064 #[doc = " depended on the allocation being replayed whenever the graph is launched, the"]
9065 #[doc = " captured graph would be invalid."]
9066 #[doc = ""]
9067 #[doc = " Therefore, stream capture places restrictions on API calls that can be made within"]
9068 #[doc = " or concurrently to a ::cudaStreamBeginCapture-::cudaStreamEndCapture sequence. This"]
9069 #[doc = " behavior can be controlled via this API and flags to ::cudaStreamBeginCapture."]
9070 #[doc = ""]
9071 #[doc = " A thread's mode is one of the following:"]
9072 #[doc = " - \\p cudaStreamCaptureModeGlobal: This is the default mode. If the local thread has"]
9073 #[doc = " an ongoing capture sequence that was not initiated with"]
9074 #[doc = " \\p cudaStreamCaptureModeRelaxed at \\p cuStreamBeginCapture, or if any other thread"]
9075 #[doc = " has a concurrent capture sequence initiated with \\p cudaStreamCaptureModeGlobal,"]
9076 #[doc = " this thread is prohibited from potentially unsafe API calls."]
9077 #[doc = " - \\p cudaStreamCaptureModeThreadLocal: If the local thread has an ongoing capture"]
9078 #[doc = " sequence not initiated with \\p cudaStreamCaptureModeRelaxed, it is prohibited"]
9079 #[doc = " from potentially unsafe API calls. Concurrent capture sequences in other threads"]
9080 #[doc = " are ignored."]
9081 #[doc = " - \\p cudaStreamCaptureModeRelaxed: The local thread is not prohibited from potentially"]
9082 #[doc = " unsafe API calls. Note that the thread is still prohibited from API calls which"]
9083 #[doc = " necessarily conflict with stream capture, for example, attempting ::cudaEventQuery"]
9084 #[doc = " on an event that was last recorded inside a capture sequence."]
9085 #[doc = ""]
9086 #[doc = " \\param mode - Pointer to mode value to swap with the current mode"]
9087 #[doc = ""]
9088 #[doc = " \\return"]
9089 #[doc = " ::cudaSuccess,"]
9090 #[doc = " ::cudaErrorInvalidValue"]
9091 #[doc = " \\notefnerr"]
9092 #[doc = ""]
9093 #[doc = " \\sa"]
9094 #[doc = " ::cudaStreamBeginCapture"]
9095 pub fn cudaThreadExchangeStreamCaptureMode(mode: *mut cudaStreamCaptureMode) -> cudaError_t;
9096}
9097extern "C" {
9098 #[doc = " \\brief Ends capture on a stream, returning the captured graph"]
9099 #[doc = ""]
9100 #[doc = " End capture on \\p stream, returning the captured graph via \\p pGraph."]
9101 #[doc = " Capture must have been initiated on \\p stream via a call to ::cudaStreamBeginCapture."]
9102 #[doc = " If capture was invalidated, due to a violation of the rules of stream capture, then"]
9103 #[doc = " a NULL graph will be returned."]
9104 #[doc = ""]
9105 #[doc = " If the \\p mode argument to ::cudaStreamBeginCapture was not"]
9106 #[doc = " ::cudaStreamCaptureModeRelaxed, this call must be from the same thread as"]
9107 #[doc = " ::cudaStreamBeginCapture."]
9108 #[doc = ""]
9109 #[doc = " \\param stream - Stream to query"]
9110 #[doc = " \\param pGraph - The captured graph"]
9111 #[doc = ""]
9112 #[doc = " \\return"]
9113 #[doc = " ::cudaSuccess,"]
9114 #[doc = " ::cudaErrorInvalidValue,"]
9115 #[doc = " ::cudaErrorStreamCaptureWrongThread"]
9116 #[doc = " \\notefnerr"]
9117 #[doc = ""]
9118 #[doc = " \\sa"]
9119 #[doc = " ::cudaStreamCreate,"]
9120 #[doc = " ::cudaStreamBeginCapture,"]
9121 #[doc = " ::cudaStreamIsCapturing"]
9122 pub fn cudaStreamEndCapture(stream: cudaStream_t, pGraph: *mut cudaGraph_t) -> cudaError_t;
9123}
9124extern "C" {
9125 #[doc = " \\brief Returns a stream's capture status"]
9126 #[doc = ""]
9127 #[doc = " Return the capture status of \\p stream via \\p pCaptureStatus. After a successful"]
9128 #[doc = " call, \\p *pCaptureStatus will contain one of the following:"]
9129 #[doc = " - ::cudaStreamCaptureStatusNone: The stream is not capturing."]
9130 #[doc = " - ::cudaStreamCaptureStatusActive: The stream is capturing."]
9131 #[doc = " - ::cudaStreamCaptureStatusInvalidated: The stream was capturing but an error"]
9132 #[doc = " has invalidated the capture sequence. The capture sequence must be terminated"]
9133 #[doc = " with ::cudaStreamEndCapture on the stream where it was initiated in order to"]
9134 #[doc = " continue using \\p stream."]
9135 #[doc = ""]
9136 #[doc = " Note that, if this is called on ::cudaStreamLegacy (the \"null stream\") while"]
9137 #[doc = " a blocking stream on the same device is capturing, it will return"]
9138 #[doc = " ::cudaErrorStreamCaptureImplicit and \\p *pCaptureStatus is unspecified"]
9139 #[doc = " after the call. The blocking stream capture is not invalidated."]
9140 #[doc = ""]
9141 #[doc = " When a blocking stream is capturing, the legacy stream is in an"]
9142 #[doc = " unusable state until the blocking stream capture is terminated. The legacy"]
9143 #[doc = " stream is not supported for stream capture, but attempted use would have an"]
9144 #[doc = " implicit dependency on the capturing stream(s)."]
9145 #[doc = ""]
9146 #[doc = " \\param stream - Stream to query"]
9147 #[doc = " \\param pCaptureStatus - Returns the stream's capture status"]
9148 #[doc = ""]
9149 #[doc = " \\return"]
9150 #[doc = " ::cudaSuccess,"]
9151 #[doc = " ::cudaErrorInvalidValue,"]
9152 #[doc = " ::cudaErrorStreamCaptureImplicit"]
9153 #[doc = " \\notefnerr"]
9154 #[doc = ""]
9155 #[doc = " \\sa"]
9156 #[doc = " ::cudaStreamCreate,"]
9157 #[doc = " ::cudaStreamBeginCapture,"]
9158 #[doc = " ::cudaStreamEndCapture"]
9159 pub fn cudaStreamIsCapturing(
9160 stream: cudaStream_t,
9161 pCaptureStatus: *mut cudaStreamCaptureStatus,
9162 ) -> cudaError_t;
9163}
9164extern "C" {
9165 #[doc = " \\brief Query capture status of a stream"]
9166 #[doc = ""]
9167 #[doc = " Note there is a later version of this API, ::cudaStreamGetCaptureInfo_v2. It will"]
9168 #[doc = " supplant this version in 12.0, which is retained for minor version compatibility."]
9169 #[doc = ""]
9170 #[doc = " Query the capture status of a stream and get a unique id representing"]
9171 #[doc = " the capture sequence over the lifetime of the process."]
9172 #[doc = ""]
9173 #[doc = " If called on ::cudaStreamLegacy (the \"null stream\") while a stream not created"]
9174 #[doc = " with ::cudaStreamNonBlocking is capturing, returns ::cudaErrorStreamCaptureImplicit."]
9175 #[doc = ""]
9176 #[doc = " A valid id is returned only if both of the following are true:"]
9177 #[doc = " - the call returns ::cudaSuccess"]
9178 #[doc = " - captureStatus is set to ::cudaStreamCaptureStatusActive"]
9179 #[doc = ""]
9180 #[doc = " \\param stream - Stream to query"]
9181 #[doc = " \\param pCaptureStatus - Returns the stream's capture status"]
9182 #[doc = " \\param pId - Returns the unique id of the capture sequence"]
9183 #[doc = ""]
9184 #[doc = " \\return"]
9185 #[doc = " ::cudaSuccess,"]
9186 #[doc = " ::cudaErrorStreamCaptureImplicit"]
9187 #[doc = " \\notefnerr"]
9188 #[doc = ""]
9189 #[doc = " \\sa"]
9190 #[doc = " ::cudaStreamGetCaptureInfo_v2,"]
9191 #[doc = " ::cudaStreamBeginCapture,"]
9192 #[doc = " ::cudaStreamIsCapturing"]
9193 pub fn cudaStreamGetCaptureInfo(
9194 stream: cudaStream_t,
9195 pCaptureStatus: *mut cudaStreamCaptureStatus,
9196 pId: *mut ::libc::c_ulonglong,
9197 ) -> cudaError_t;
9198}
9199extern "C" {
9200 #[doc = " \\brief Query a stream's capture state (11.3+)"]
9201 #[doc = ""]
9202 #[doc = " Query stream state related to stream capture."]
9203 #[doc = ""]
9204 #[doc = " If called on ::cudaStreamLegacy (the \"null stream\") while a stream not created"]
9205 #[doc = " with ::cudaStreamNonBlocking is capturing, returns ::cudaErrorStreamCaptureImplicit."]
9206 #[doc = ""]
9207 #[doc = " Valid data (other than capture status) is returned only if both of the following are true:"]
9208 #[doc = " - the call returns cudaSuccess"]
9209 #[doc = " - the returned capture status is ::cudaStreamCaptureStatusActive"]
9210 #[doc = ""]
9211 #[doc = " This version of cudaStreamGetCaptureInfo is introduced in CUDA 11.3 and will supplant the"]
9212 #[doc = " previous version ::cudaStreamGetCaptureInfo in 12.0. Developers requiring compatibility"]
9213 #[doc = " across minor versions to CUDA 11.0 (driver version 445) can do one of the following:"]
9214 #[doc = " - Use the older version of the API, ::cudaStreamGetCaptureInfo"]
9215 #[doc = " - Pass null for all of \\p graph_out, \\p dependencies_out, and \\p numDependencies_out."]
9216 #[doc = ""]
9217 #[doc = " \\param stream - The stream to query"]
9218 #[doc = " \\param captureStatus_out - Location to return the capture status of the stream; required"]
9219 #[doc = " \\param id_out - Optional location to return an id for the capture sequence, which is"]
9220 #[doc = " unique over the lifetime of the process"]
9221 #[doc = " \\param graph_out - Optional location to return the graph being captured into. All"]
9222 #[doc = " operations other than destroy and node removal are permitted on the graph"]
9223 #[doc = " while the capture sequence is in progress. This API does not transfer"]
9224 #[doc = " ownership of the graph, which is transferred or destroyed at"]
9225 #[doc = " ::cudaStreamEndCapture. Note that the graph handle may be invalidated before"]
9226 #[doc = " end of capture for certain errors. Nodes that are or become"]
9227 #[doc = " unreachable from the original stream at ::cudaStreamEndCapture due to direct"]
9228 #[doc = " actions on the graph do not trigger ::cudaErrorStreamCaptureUnjoined."]
9229 #[doc = " \\param dependencies_out - Optional location to store a pointer to an array of nodes."]
9230 #[doc = " The next node to be captured in the stream will depend on this set of nodes,"]
9231 #[doc = " absent operations such as event wait which modify this set. The array pointer"]
9232 #[doc = " is valid until the next API call which operates on the stream or until end of"]
9233 #[doc = " capture. The node handles may be copied out and are valid until they or the"]
9234 #[doc = " graph is destroyed. The driver-owned array may also be passed directly to"]
9235 #[doc = " APIs that operate on the graph (not the stream) without copying."]
9236 #[doc = " \\param numDependencies_out - Optional location to store the size of the array"]
9237 #[doc = " returned in dependencies_out."]
9238 #[doc = ""]
9239 #[doc = " \\return"]
9240 #[doc = " ::cudaSuccess,"]
9241 #[doc = " ::cudaErrorInvalidValue,"]
9242 #[doc = " ::cudaErrorStreamCaptureImplicit"]
9243 #[doc = " \\note_graph_thread_safety"]
9244 #[doc = " \\notefnerr"]
9245 #[doc = ""]
9246 #[doc = " \\sa"]
9247 #[doc = " ::cudaStreamGetCaptureInfo,"]
9248 #[doc = " ::cudaStreamBeginCapture,"]
9249 #[doc = " ::cudaStreamIsCapturing,"]
9250 #[doc = " ::cudaStreamUpdateCaptureDependencies"]
9251 pub fn cudaStreamGetCaptureInfo_v2(
9252 stream: cudaStream_t,
9253 captureStatus_out: *mut cudaStreamCaptureStatus,
9254 id_out: *mut ::libc::c_ulonglong,
9255 graph_out: *mut cudaGraph_t,
9256 dependencies_out: *mut *const cudaGraphNode_t,
9257 numDependencies_out: *mut usize,
9258 ) -> cudaError_t;
9259}
9260extern "C" {
9261 #[doc = " \\brief Update the set of dependencies in a capturing stream (11.3+)"]
9262 #[doc = ""]
9263 #[doc = " Modifies the dependency set of a capturing stream. The dependency set is the set"]
9264 #[doc = " of nodes that the next captured node in the stream will depend on."]
9265 #[doc = ""]
9266 #[doc = " Valid flags are ::cudaStreamAddCaptureDependencies and"]
9267 #[doc = " ::cudaStreamSetCaptureDependencies. These control whether the set passed to"]
9268 #[doc = " the API is added to the existing set or replaces it. A flags value of 0 defaults"]
9269 #[doc = " to ::cudaStreamAddCaptureDependencies."]
9270 #[doc = ""]
9271 #[doc = " Nodes that are removed from the dependency set via this API do not result in"]
9272 #[doc = " ::cudaErrorStreamCaptureUnjoined if they are unreachable from the stream at"]
9273 #[doc = " ::cudaStreamEndCapture."]
9274 #[doc = ""]
9275 #[doc = " Returns ::cudaErrorIllegalState if the stream is not capturing."]
9276 #[doc = ""]
9277 #[doc = " This API is new in CUDA 11.3. Developers requiring compatibility across minor"]
9278 #[doc = " versions of the CUDA driver to 11.0 should not use this API or provide a fallback."]
9279 #[doc = ""]
9280 #[doc = " \\return"]
9281 #[doc = " ::cudaSuccess,"]
9282 #[doc = " ::cudaErrorInvalidValue,"]
9283 #[doc = " ::cudaErrorIllegalState"]
9284 #[doc = " \\notefnerr"]
9285 #[doc = ""]
9286 #[doc = " \\sa"]
9287 #[doc = " ::cudaStreamBeginCapture,"]
9288 #[doc = " ::cudaStreamGetCaptureInfo,"]
9289 #[doc = " ::cudaStreamGetCaptureInfo_v2"]
9290 pub fn cudaStreamUpdateCaptureDependencies(
9291 stream: cudaStream_t,
9292 dependencies: *mut cudaGraphNode_t,
9293 numDependencies: usize,
9294 flags: ::libc::c_uint,
9295 ) -> cudaError_t;
9296}
9297extern "C" {
9298 #[doc = " \\brief Creates an event object"]
9299 #[doc = ""]
9300 #[doc = " Creates an event object for the current device using ::cudaEventDefault."]
9301 #[doc = ""]
9302 #[doc = " \\param event - Newly created event"]
9303 #[doc = ""]
9304 #[doc = " \\return"]
9305 #[doc = " ::cudaSuccess,"]
9306 #[doc = " ::cudaErrorInvalidValue,"]
9307 #[doc = " ::cudaErrorLaunchFailure,"]
9308 #[doc = " ::cudaErrorMemoryAllocation"]
9309 #[doc = " \\notefnerr"]
9310 #[doc = " \\note_init_rt"]
9311 #[doc = " \\note_callback"]
9312 #[doc = ""]
9313 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*, unsigned int) \"cudaEventCreate (C++ API)\","]
9314 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventRecord, ::cudaEventQuery,"]
9315 #[doc = " ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventElapsedTime,"]
9316 #[doc = " ::cudaStreamWaitEvent,"]
9317 #[doc = " ::cuEventCreate"]
9318 pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
9319}
9320extern "C" {
9321 #[doc = " \\brief Creates an event object with the specified flags"]
9322 #[doc = ""]
9323 #[doc = " Creates an event object for the current device with the specified flags. Valid"]
9324 #[doc = " flags include:"]
9325 #[doc = " - ::cudaEventDefault: Default event creation flag."]
9326 #[doc = " - ::cudaEventBlockingSync: Specifies that event should use blocking"]
9327 #[doc = " synchronization. A host thread that uses ::cudaEventSynchronize() to wait"]
9328 #[doc = " on an event created with this flag will block until the event actually"]
9329 #[doc = " completes."]
9330 #[doc = " - ::cudaEventDisableTiming: Specifies that the created event does not need"]
9331 #[doc = " to record timing data. Events created with this flag specified and"]
9332 #[doc = " the ::cudaEventBlockingSync flag not specified will provide the best"]
9333 #[doc = " performance when used with ::cudaStreamWaitEvent() and ::cudaEventQuery()."]
9334 #[doc = " - ::cudaEventInterprocess: Specifies that the created event may be used as an"]
9335 #[doc = " interprocess event by ::cudaIpcGetEventHandle(). ::cudaEventInterprocess must"]
9336 #[doc = " be specified along with ::cudaEventDisableTiming."]
9337 #[doc = ""]
9338 #[doc = " \\param event - Newly created event"]
9339 #[doc = " \\param flags - Flags for new event"]
9340 #[doc = ""]
9341 #[doc = " \\return"]
9342 #[doc = " ::cudaSuccess,"]
9343 #[doc = " ::cudaErrorInvalidValue,"]
9344 #[doc = " ::cudaErrorLaunchFailure,"]
9345 #[doc = " ::cudaErrorMemoryAllocation"]
9346 #[doc = " \\notefnerr"]
9347 #[doc = " \\note_init_rt"]
9348 #[doc = " \\note_callback"]
9349 #[doc = ""]
9350 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9351 #[doc = " ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventElapsedTime,"]
9352 #[doc = " ::cudaStreamWaitEvent,"]
9353 #[doc = " ::cuEventCreate"]
9354 pub fn cudaEventCreateWithFlags(event: *mut cudaEvent_t, flags: ::libc::c_uint) -> cudaError_t;
9355}
9356extern "C" {
9357 #[doc = " \\brief Records an event"]
9358 #[doc = ""]
9359 #[doc = " Captures in \\p event the contents of \\p stream at the time of this call."]
9360 #[doc = " \\p event and \\p stream must be on the same device."]
9361 #[doc = " Calls such as ::cudaEventQuery() or ::cudaStreamWaitEvent() will then"]
9362 #[doc = " examine or wait for completion of the work that was captured. Uses of"]
9363 #[doc = " \\p stream after this call do not modify \\p event. See note on default"]
9364 #[doc = " stream behavior for what is captured in the default case."]
9365 #[doc = ""]
9366 #[doc = " ::cudaEventRecord() can be called multiple times on the same event and"]
9367 #[doc = " will overwrite the previously captured state. Other APIs such as"]
9368 #[doc = " ::cudaStreamWaitEvent() use the most recently captured state at the time"]
9369 #[doc = " of the API call, and are not affected by later calls to"]
9370 #[doc = " ::cudaEventRecord(). Before the first call to ::cudaEventRecord(), an"]
9371 #[doc = " event represents an empty set of work, so for example ::cudaEventQuery()"]
9372 #[doc = " would return ::cudaSuccess."]
9373 #[doc = ""]
9374 #[doc = " \\param event - Event to record"]
9375 #[doc = " \\param stream - Stream in which to record event"]
9376 #[doc = ""]
9377 #[doc = " \\return"]
9378 #[doc = " ::cudaSuccess,"]
9379 #[doc = " ::cudaErrorInvalidValue,"]
9380 #[doc = " ::cudaErrorInvalidResourceHandle,"]
9381 #[doc = " ::cudaErrorLaunchFailure"]
9382 #[doc = " \\note_null_stream"]
9383 #[doc = " \\notefnerr"]
9384 #[doc = " \\note_init_rt"]
9385 #[doc = " \\note_callback"]
9386 #[doc = ""]
9387 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9388 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventQuery,"]
9389 #[doc = " ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventElapsedTime,"]
9390 #[doc = " ::cudaStreamWaitEvent,"]
9391 #[doc = " ::cudaEventRecordWithFlags,"]
9392 #[doc = " ::cuEventRecord"]
9393 pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
9394}
9395extern "C" {
9396 pub fn cudaEventRecordWithFlags(
9397 event: cudaEvent_t,
9398 stream: cudaStream_t,
9399 flags: ::libc::c_uint,
9400 ) -> cudaError_t;
9401}
9402extern "C" {
9403 #[doc = " \\brief Queries an event's status"]
9404 #[doc = ""]
9405 #[doc = " Queries the status of all work currently captured by \\p event. See"]
9406 #[doc = " ::cudaEventRecord() for details on what is captured by an event."]
9407 #[doc = ""]
9408 #[doc = " Returns ::cudaSuccess if all captured work has been completed, or"]
9409 #[doc = " ::cudaErrorNotReady if any captured work is incomplete."]
9410 #[doc = ""]
9411 #[doc = " For the purposes of Unified Memory, a return value of ::cudaSuccess"]
9412 #[doc = " is equivalent to having called ::cudaEventSynchronize()."]
9413 #[doc = ""]
9414 #[doc = " \\param event - Event to query"]
9415 #[doc = ""]
9416 #[doc = " \\return"]
9417 #[doc = " ::cudaSuccess,"]
9418 #[doc = " ::cudaErrorNotReady,"]
9419 #[doc = " ::cudaErrorInvalidValue,"]
9420 #[doc = " ::cudaErrorInvalidResourceHandle,"]
9421 #[doc = " ::cudaErrorLaunchFailure"]
9422 #[doc = " \\notefnerr"]
9423 #[doc = " \\note_init_rt"]
9424 #[doc = " \\note_callback"]
9425 #[doc = ""]
9426 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9427 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventRecord,"]
9428 #[doc = " ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventElapsedTime,"]
9429 #[doc = " ::cuEventQuery"]
9430 pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
9431}
9432extern "C" {
9433 #[doc = " \\brief Waits for an event to complete"]
9434 #[doc = ""]
9435 #[doc = " Waits until the completion of all work currently captured in \\p event."]
9436 #[doc = " See ::cudaEventRecord() for details on what is captured by an event."]
9437 #[doc = ""]
9438 #[doc = " Waiting for an event that was created with the ::cudaEventBlockingSync"]
9439 #[doc = " flag will cause the calling CPU thread to block until the event has"]
9440 #[doc = " been completed by the device. If the ::cudaEventBlockingSync flag has"]
9441 #[doc = " not been set, then the CPU thread will busy-wait until the event has"]
9442 #[doc = " been completed by the device."]
9443 #[doc = ""]
9444 #[doc = " \\param event - Event to wait for"]
9445 #[doc = ""]
9446 #[doc = " \\return"]
9447 #[doc = " ::cudaSuccess,"]
9448 #[doc = " ::cudaErrorInvalidValue,"]
9449 #[doc = " ::cudaErrorInvalidResourceHandle,"]
9450 #[doc = " ::cudaErrorLaunchFailure"]
9451 #[doc = " \\notefnerr"]
9452 #[doc = " \\note_init_rt"]
9453 #[doc = " \\note_callback"]
9454 #[doc = ""]
9455 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9456 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventRecord,"]
9457 #[doc = " ::cudaEventQuery, ::cudaEventDestroy, ::cudaEventElapsedTime,"]
9458 #[doc = " ::cuEventSynchronize"]
9459 pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
9460}
9461extern "C" {
9462 #[doc = " \\brief Destroys an event object"]
9463 #[doc = ""]
9464 #[doc = " Destroys the event specified by \\p event."]
9465 #[doc = ""]
9466 #[doc = " An event may be destroyed before it is complete (i.e., while"]
9467 #[doc = " ::cudaEventQuery() would return ::cudaErrorNotReady). In this case, the"]
9468 #[doc = " call does not block on completion of the event, and any associated"]
9469 #[doc = " resources will automatically be released asynchronously at completion."]
9470 #[doc = ""]
9471 #[doc = " \\param event - Event to destroy"]
9472 #[doc = ""]
9473 #[doc = " \\return"]
9474 #[doc = " ::cudaSuccess,"]
9475 #[doc = " ::cudaErrorInvalidValue,"]
9476 #[doc = " ::cudaErrorInvalidResourceHandle,"]
9477 #[doc = " ::cudaErrorLaunchFailure"]
9478 #[doc = " \\notefnerr"]
9479 #[doc = " \\note_init_rt"]
9480 #[doc = " \\note_callback"]
9481 #[doc = " \\note_destroy_ub"]
9482 #[doc = ""]
9483 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9484 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventQuery,"]
9485 #[doc = " ::cudaEventSynchronize, ::cudaEventRecord, ::cudaEventElapsedTime,"]
9486 #[doc = " ::cuEventDestroy"]
9487 pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
9488}
9489extern "C" {
9490 #[doc = " \\brief Computes the elapsed time between events"]
9491 #[doc = ""]
9492 #[doc = " Computes the elapsed time between two events (in milliseconds with a"]
9493 #[doc = " resolution of around 0.5 microseconds)."]
9494 #[doc = ""]
9495 #[doc = " If either event was last recorded in a non-NULL stream, the resulting time"]
9496 #[doc = " may be greater than expected (even if both used the same stream handle). This"]
9497 #[doc = " happens because the ::cudaEventRecord() operation takes place asynchronously"]
9498 #[doc = " and there is no guarantee that the measured latency is actually just between"]
9499 #[doc = " the two events. Any number of other different stream operations could execute"]
9500 #[doc = " in between the two measured events, thus altering the timing in a significant"]
9501 #[doc = " way."]
9502 #[doc = ""]
9503 #[doc = " If ::cudaEventRecord() has not been called on either event, then"]
9504 #[doc = " ::cudaErrorInvalidResourceHandle is returned. If ::cudaEventRecord() has been"]
9505 #[doc = " called on both events but one or both of them has not yet been completed"]
9506 #[doc = " (that is, ::cudaEventQuery() would return ::cudaErrorNotReady on at least one"]
9507 #[doc = " of the events), ::cudaErrorNotReady is returned. If either event was created"]
9508 #[doc = " with the ::cudaEventDisableTiming flag, then this function will return"]
9509 #[doc = " ::cudaErrorInvalidResourceHandle."]
9510 #[doc = ""]
9511 #[doc = " \\param ms - Time between \\p start and \\p end in ms"]
9512 #[doc = " \\param start - Starting event"]
9513 #[doc = " \\param end - Ending event"]
9514 #[doc = ""]
9515 #[doc = " \\return"]
9516 #[doc = " ::cudaSuccess,"]
9517 #[doc = " ::cudaErrorNotReady,"]
9518 #[doc = " ::cudaErrorInvalidValue,"]
9519 #[doc = " ::cudaErrorInvalidResourceHandle,"]
9520 #[doc = " ::cudaErrorLaunchFailure"]
9521 #[doc = " \\notefnerr"]
9522 #[doc = " \\note_init_rt"]
9523 #[doc = " \\note_callback"]
9524 #[doc = ""]
9525 #[doc = " \\sa \\ref ::cudaEventCreate(cudaEvent_t*) \"cudaEventCreate (C API)\","]
9526 #[doc = " ::cudaEventCreateWithFlags, ::cudaEventQuery,"]
9527 #[doc = " ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventRecord,"]
9528 #[doc = " ::cuEventElapsedTime"]
9529 pub fn cudaEventElapsedTime(ms: *mut f32, start: cudaEvent_t, end: cudaEvent_t) -> cudaError_t;
9530}
9531extern "C" {
9532 #[doc = " \\brief Imports an external memory object"]
9533 #[doc = ""]
9534 #[doc = " Imports an externally allocated memory object and returns"]
9535 #[doc = " a handle to that in \\p extMem_out."]
9536 #[doc = ""]
9537 #[doc = " The properties of the handle being imported must be described in"]
9538 #[doc = " \\p memHandleDesc. The ::cudaExternalMemoryHandleDesc structure"]
9539 #[doc = " is defined as follows:"]
9540 #[doc = ""]
9541 #[doc = " \\code"]
9542 #[doc = "typedef struct cudaExternalMemoryHandleDesc_st {"]
9543 #[doc = "cudaExternalMemoryHandleType type;"]
9544 #[doc = "union {"]
9545 #[doc = "int fd;"]
9546 #[doc = "struct {"]
9547 #[doc = "void *handle;"]
9548 #[doc = "const void *name;"]
9549 #[doc = "} win32;"]
9550 #[doc = "const void *nvSciBufObject;"]
9551 #[doc = "} handle;"]
9552 #[doc = "unsigned long long size;"]
9553 #[doc = "unsigned int flags;"]
9554 #[doc = "} cudaExternalMemoryHandleDesc;"]
9555 #[doc = " \\endcode"]
9556 #[doc = ""]
9557 #[doc = " where ::cudaExternalMemoryHandleDesc::type specifies the type"]
9558 #[doc = " of handle being imported. ::cudaExternalMemoryHandleType is"]
9559 #[doc = " defined as:"]
9560 #[doc = ""]
9561 #[doc = " \\code"]
9562 #[doc = "typedef enum cudaExternalMemoryHandleType_enum {"]
9563 #[doc = "cudaExternalMemoryHandleTypeOpaqueFd = 1,"]
9564 #[doc = "cudaExternalMemoryHandleTypeOpaqueWin32 = 2,"]
9565 #[doc = "cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3,"]
9566 #[doc = "cudaExternalMemoryHandleTypeD3D12Heap = 4,"]
9567 #[doc = "cudaExternalMemoryHandleTypeD3D12Resource = 5,"]
9568 #[doc = "cudaExternalMemoryHandleTypeD3D11Resource = 6,"]
9569 #[doc = "cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7,"]
9570 #[doc = "cudaExternalMemoryHandleTypeNvSciBuf = 8"]
9571 #[doc = "} cudaExternalMemoryHandleType;"]
9572 #[doc = " \\endcode"]
9573 #[doc = ""]
9574 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9575 #[doc = " ::cudaExternalMemoryHandleTypeOpaqueFd, then"]
9576 #[doc = " ::cudaExternalMemoryHandleDesc::handle::fd must be a valid"]
9577 #[doc = " file descriptor referencing a memory object. Ownership of"]
9578 #[doc = " the file descriptor is transferred to the CUDA driver when the"]
9579 #[doc = " handle is imported successfully. Performing any operations on the"]
9580 #[doc = " file descriptor after it is imported results in undefined behavior."]
9581 #[doc = ""]
9582 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9583 #[doc = " ::cudaExternalMemoryHandleTypeOpaqueWin32, then exactly one"]
9584 #[doc = " of ::cudaExternalMemoryHandleDesc::handle::win32::handle and"]
9585 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name must not be"]
9586 #[doc = " NULL. If ::cudaExternalMemoryHandleDesc::handle::win32::handle"]
9587 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9588 #[doc = " references a memory object. Ownership of this handle is"]
9589 #[doc = " not transferred to CUDA after the import operation, so the"]
9590 #[doc = " application must release the handle using the appropriate system"]
9591 #[doc = " call. If ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9592 #[doc = " is not NULL, then it must point to a NULL-terminated array of"]
9593 #[doc = " UTF-16 characters that refers to a memory object."]
9594 #[doc = ""]
9595 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9596 #[doc = " ::cudaExternalMemoryHandleTypeOpaqueWin32Kmt, then"]
9597 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::handle must"]
9598 #[doc = " be non-NULL and"]
9599 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9600 #[doc = " must be NULL. The handle specified must be a globally shared KMT"]
9601 #[doc = " handle. This handle does not hold a reference to the underlying"]
9602 #[doc = " object, and thus will be invalid when all references to the"]
9603 #[doc = " memory object are destroyed."]
9604 #[doc = ""]
9605 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9606 #[doc = " ::cudaExternalMemoryHandleTypeD3D12Heap, then exactly one"]
9607 #[doc = " of ::cudaExternalMemoryHandleDesc::handle::win32::handle and"]
9608 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name must not be"]
9609 #[doc = " NULL. If ::cudaExternalMemoryHandleDesc::handle::win32::handle"]
9610 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9611 #[doc = " is returned by ID3D12Device::CreateSharedHandle when referring to a"]
9612 #[doc = " ID3D12Heap object. This handle holds a reference to the underlying"]
9613 #[doc = " object. If ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9614 #[doc = " is not NULL, then it must point to a NULL-terminated array of"]
9615 #[doc = " UTF-16 characters that refers to a ID3D12Heap object."]
9616 #[doc = ""]
9617 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9618 #[doc = " ::cudaExternalMemoryHandleTypeD3D12Resource, then exactly one"]
9619 #[doc = " of ::cudaExternalMemoryHandleDesc::handle::win32::handle and"]
9620 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name must not be"]
9621 #[doc = " NULL. If ::cudaExternalMemoryHandleDesc::handle::win32::handle"]
9622 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9623 #[doc = " is returned by ID3D12Device::CreateSharedHandle when referring to a"]
9624 #[doc = " ID3D12Resource object. This handle holds a reference to the"]
9625 #[doc = " underlying object. If"]
9626 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9627 #[doc = " is not NULL, then it must point to a NULL-terminated array of"]
9628 #[doc = " UTF-16 characters that refers to a ID3D12Resource object."]
9629 #[doc = ""]
9630 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9631 #[doc = " ::cudaExternalMemoryHandleTypeD3D11Resource,then exactly one"]
9632 #[doc = " of ::cudaExternalMemoryHandleDesc::handle::win32::handle and"]
9633 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name must not be"]
9634 #[doc = " NULL. If ::cudaExternalMemoryHandleDesc::handle::win32::handle is"]
9635 #[doc = " not NULL, then it must represent a valid shared NT handle that is"]
9636 #[doc = " returned by IDXGIResource1::CreateSharedHandle when referring to a"]
9637 #[doc = " ID3D11Resource object. If"]
9638 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9639 #[doc = " is not NULL, then it must point to a NULL-terminated array of"]
9640 #[doc = " UTF-16 characters that refers to a ID3D11Resource object."]
9641 #[doc = ""]
9642 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9643 #[doc = " ::cudaExternalMemoryHandleTypeD3D11ResourceKmt, then"]
9644 #[doc = " ::cudaExternalMemoryHandleDesc::handle::win32::handle must"]
9645 #[doc = " be non-NULL and ::cudaExternalMemoryHandleDesc::handle::win32::name"]
9646 #[doc = " must be NULL. The handle specified must be a valid shared KMT"]
9647 #[doc = " handle that is returned by IDXGIResource::GetSharedHandle when"]
9648 #[doc = " referring to a ID3D11Resource object."]
9649 #[doc = ""]
9650 #[doc = " If ::cudaExternalMemoryHandleDesc::type is"]
9651 #[doc = " ::cudaExternalMemoryHandleTypeNvSciBuf, then"]
9652 #[doc = " ::cudaExternalMemoryHandleDesc::handle::nvSciBufObject must be NON-NULL"]
9653 #[doc = " and reference a valid NvSciBuf object."]
9654 #[doc = " If the NvSciBuf object imported into CUDA is also mapped by other drivers, then the"]
9655 #[doc = " application must use ::cudaWaitExternalSemaphoresAsync or ::cudaSignalExternalSemaphoresAsync"]
9656 #[doc = " as approprriate barriers to maintain coherence between CUDA and the other drivers."]
9657 #[doc = ""]
9658 #[doc = " The size of the memory object must be specified in"]
9659 #[doc = " ::cudaExternalMemoryHandleDesc::size."]
9660 #[doc = ""]
9661 #[doc = " Specifying the flag ::cudaExternalMemoryDedicated in"]
9662 #[doc = " ::cudaExternalMemoryHandleDesc::flags indicates that the"]
9663 #[doc = " resource is a dedicated resource. The definition of what a"]
9664 #[doc = " dedicated resource is outside the scope of this extension."]
9665 #[doc = " This flag must be set if ::cudaExternalMemoryHandleDesc::type"]
9666 #[doc = " is one of the following:"]
9667 #[doc = " ::cudaExternalMemoryHandleTypeD3D12Resource"]
9668 #[doc = " ::cudaExternalMemoryHandleTypeD3D11Resource"]
9669 #[doc = " ::cudaExternalMemoryHandleTypeD3D11ResourceKmt"]
9670 #[doc = ""]
9671 #[doc = " \\param extMem_out - Returned handle to an external memory object"]
9672 #[doc = " \\param memHandleDesc - Memory import handle descriptor"]
9673 #[doc = ""]
9674 #[doc = " \\return"]
9675 #[doc = " ::cudaSuccess,"]
9676 #[doc = " ::cudaErrorInvalidResourceHandle"]
9677 #[doc = " \\notefnerr"]
9678 #[doc = " \\note_init_rt"]
9679 #[doc = " \\note_callback"]
9680 #[doc = ""]
9681 #[doc = " \\note If the Vulkan memory imported into CUDA is mapped on the CPU then the"]
9682 #[doc = " application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges"]
9683 #[doc = " as well as appropriate Vulkan pipeline barriers to maintain coherence between"]
9684 #[doc = " CPU and GPU. For more information on these APIs, please refer to \"Synchronization"]
9685 #[doc = " and Cache Control\" chapter from Vulkan specification."]
9686 #[doc = ""]
9687 #[doc = ""]
9688 #[doc = " \\sa ::cudaDestroyExternalMemory,"]
9689 #[doc = " ::cudaExternalMemoryGetMappedBuffer,"]
9690 #[doc = " ::cudaExternalMemoryGetMappedMipmappedArray"]
9691 pub fn cudaImportExternalMemory(
9692 extMem_out: *mut cudaExternalMemory_t,
9693 memHandleDesc: *const cudaExternalMemoryHandleDesc,
9694 ) -> cudaError_t;
9695}
9696extern "C" {
9697 #[doc = " \\brief Maps a buffer onto an imported memory object"]
9698 #[doc = ""]
9699 #[doc = " Maps a buffer onto an imported memory object and returns a device"]
9700 #[doc = " pointer in \\p devPtr."]
9701 #[doc = ""]
9702 #[doc = " The properties of the buffer being mapped must be described in"]
9703 #[doc = " \\p bufferDesc. The ::cudaExternalMemoryBufferDesc structure is"]
9704 #[doc = " defined as follows:"]
9705 #[doc = ""]
9706 #[doc = " \\code"]
9707 #[doc = "typedef struct cudaExternalMemoryBufferDesc_st {"]
9708 #[doc = "unsigned long long offset;"]
9709 #[doc = "unsigned long long size;"]
9710 #[doc = "unsigned int flags;"]
9711 #[doc = "} cudaExternalMemoryBufferDesc;"]
9712 #[doc = " \\endcode"]
9713 #[doc = ""]
9714 #[doc = " where ::cudaExternalMemoryBufferDesc::offset is the offset in"]
9715 #[doc = " the memory object where the buffer's base address is."]
9716 #[doc = " ::cudaExternalMemoryBufferDesc::size is the size of the buffer."]
9717 #[doc = " ::cudaExternalMemoryBufferDesc::flags must be zero."]
9718 #[doc = ""]
9719 #[doc = " The offset and size have to be suitably aligned to match the"]
9720 #[doc = " requirements of the external API. Mapping two buffers whose ranges"]
9721 #[doc = " overlap may or may not result in the same virtual address being"]
9722 #[doc = " returned for the overlapped portion. In such cases, the application"]
9723 #[doc = " must ensure that all accesses to that region from the GPU are"]
9724 #[doc = " volatile. Otherwise writes made via one address are not guaranteed"]
9725 #[doc = " to be visible via the other address, even if they're issued by the"]
9726 #[doc = " same thread. It is recommended that applications map the combined"]
9727 #[doc = " range instead of mapping separate buffers and then apply the"]
9728 #[doc = " appropriate offsets to the returned pointer to derive the"]
9729 #[doc = " individual buffers."]
9730 #[doc = ""]
9731 #[doc = " The returned pointer \\p devPtr must be freed using ::cudaFree."]
9732 #[doc = ""]
9733 #[doc = " \\param devPtr - Returned device pointer to buffer"]
9734 #[doc = " \\param extMem - Handle to external memory object"]
9735 #[doc = " \\param bufferDesc - Buffer descriptor"]
9736 #[doc = ""]
9737 #[doc = " \\return"]
9738 #[doc = " ::cudaSuccess,"]
9739 #[doc = " ::cudaErrorInvalidResourceHandle"]
9740 #[doc = " \\notefnerr"]
9741 #[doc = " \\note_init_rt"]
9742 #[doc = " \\note_callback"]
9743 #[doc = ""]
9744 #[doc = " \\sa ::cudaImportExternalMemory,"]
9745 #[doc = " ::cudaDestroyExternalMemory,"]
9746 #[doc = " ::cudaExternalMemoryGetMappedMipmappedArray"]
9747 pub fn cudaExternalMemoryGetMappedBuffer(
9748 devPtr: *mut *mut ::libc::c_void,
9749 extMem: cudaExternalMemory_t,
9750 bufferDesc: *const cudaExternalMemoryBufferDesc,
9751 ) -> cudaError_t;
9752}
9753extern "C" {
9754 #[doc = " \\brief Maps a CUDA mipmapped array onto an external memory object"]
9755 #[doc = ""]
9756 #[doc = " Maps a CUDA mipmapped array onto an external object and returns a"]
9757 #[doc = " handle to it in \\p mipmap."]
9758 #[doc = ""]
9759 #[doc = " The properties of the CUDA mipmapped array being mapped must be"]
9760 #[doc = " described in \\p mipmapDesc. The structure"]
9761 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc is defined as follows:"]
9762 #[doc = ""]
9763 #[doc = " \\code"]
9764 #[doc = "typedef struct cudaExternalMemoryMipmappedArrayDesc_st {"]
9765 #[doc = "unsigned long long offset;"]
9766 #[doc = "cudaChannelFormatDesc formatDesc;"]
9767 #[doc = "cudaExtent extent;"]
9768 #[doc = "unsigned int flags;"]
9769 #[doc = "unsigned int numLevels;"]
9770 #[doc = "} cudaExternalMemoryMipmappedArrayDesc;"]
9771 #[doc = " \\endcode"]
9772 #[doc = ""]
9773 #[doc = " where ::cudaExternalMemoryMipmappedArrayDesc::offset is the"]
9774 #[doc = " offset in the memory object where the base level of the mipmap"]
9775 #[doc = " chain is."]
9776 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::formatDesc describes the"]
9777 #[doc = " format of the data."]
9778 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::extent specifies the"]
9779 #[doc = " dimensions of the base level of the mipmap chain."]
9780 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::flags are flags associated"]
9781 #[doc = " with CUDA mipmapped arrays. For further details, please refer to"]
9782 #[doc = " the documentation for ::cudaMalloc3DArray. Note that if the mipmapped"]
9783 #[doc = " array is bound as a color target in the graphics API, then the flag"]
9784 #[doc = " ::cudaArrayColorAttachment must be specified in"]
9785 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::flags."]
9786 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::numLevels specifies"]
9787 #[doc = " the total number of levels in the mipmap chain."]
9788 #[doc = ""]
9789 #[doc = " The returned CUDA mipmapped array must be freed using ::cudaFreeMipmappedArray."]
9790 #[doc = ""]
9791 #[doc = " \\param mipmap - Returned CUDA mipmapped array"]
9792 #[doc = " \\param extMem - Handle to external memory object"]
9793 #[doc = " \\param mipmapDesc - CUDA array descriptor"]
9794 #[doc = ""]
9795 #[doc = " \\return"]
9796 #[doc = " ::cudaSuccess,"]
9797 #[doc = " ::cudaErrorInvalidResourceHandle"]
9798 #[doc = " \\notefnerr"]
9799 #[doc = " \\note_init_rt"]
9800 #[doc = " \\note_callback"]
9801 #[doc = ""]
9802 #[doc = " \\sa ::cudaImportExternalMemory,"]
9803 #[doc = " ::cudaDestroyExternalMemory,"]
9804 #[doc = " ::cudaExternalMemoryGetMappedBuffer"]
9805 #[doc = ""]
9806 #[doc = " \\note If ::cudaExternalMemoryHandleDesc::type is"]
9807 #[doc = " ::cudaExternalMemoryHandleTypeNvSciBuf, then"]
9808 #[doc = " ::cudaExternalMemoryMipmappedArrayDesc::numLevels must not be greater than 1."]
9809 pub fn cudaExternalMemoryGetMappedMipmappedArray(
9810 mipmap: *mut cudaMipmappedArray_t,
9811 extMem: cudaExternalMemory_t,
9812 mipmapDesc: *const cudaExternalMemoryMipmappedArrayDesc,
9813 ) -> cudaError_t;
9814}
9815extern "C" {
9816 #[doc = " \\brief Destroys an external memory object."]
9817 #[doc = ""]
9818 #[doc = " Destroys the specified external memory object. Any existing buffers"]
9819 #[doc = " and CUDA mipmapped arrays mapped onto this object must no longer be"]
9820 #[doc = " used and must be explicitly freed using ::cudaFree and"]
9821 #[doc = " ::cudaFreeMipmappedArray respectively."]
9822 #[doc = ""]
9823 #[doc = " \\param extMem - External memory object to be destroyed"]
9824 #[doc = ""]
9825 #[doc = " \\return"]
9826 #[doc = " ::cudaSuccess,"]
9827 #[doc = " ::cudaErrorInvalidResourceHandle"]
9828 #[doc = " \\notefnerr"]
9829 #[doc = " \\note_init_rt"]
9830 #[doc = " \\note_callback"]
9831 #[doc = " \\note_destroy_ub"]
9832 #[doc = ""]
9833 #[doc = " \\sa ::cudaImportExternalMemory,"]
9834 #[doc = " ::cudaExternalMemoryGetMappedBuffer,"]
9835 #[doc = " ::cudaExternalMemoryGetMappedMipmappedArray"]
9836 pub fn cudaDestroyExternalMemory(extMem: cudaExternalMemory_t) -> cudaError_t;
9837}
9838extern "C" {
9839 #[doc = " \\brief Imports an external semaphore"]
9840 #[doc = ""]
9841 #[doc = " Imports an externally allocated synchronization object and returns"]
9842 #[doc = " a handle to that in \\p extSem_out."]
9843 #[doc = ""]
9844 #[doc = " The properties of the handle being imported must be described in"]
9845 #[doc = " \\p semHandleDesc. The ::cudaExternalSemaphoreHandleDesc is defined"]
9846 #[doc = " as follows:"]
9847 #[doc = ""]
9848 #[doc = " \\code"]
9849 #[doc = "typedef struct cudaExternalSemaphoreHandleDesc_st {"]
9850 #[doc = "cudaExternalSemaphoreHandleType type;"]
9851 #[doc = "union {"]
9852 #[doc = "int fd;"]
9853 #[doc = "struct {"]
9854 #[doc = "void *handle;"]
9855 #[doc = "const void *name;"]
9856 #[doc = "} win32;"]
9857 #[doc = "const void* NvSciSyncObj;"]
9858 #[doc = "} handle;"]
9859 #[doc = "unsigned int flags;"]
9860 #[doc = "} cudaExternalSemaphoreHandleDesc;"]
9861 #[doc = " \\endcode"]
9862 #[doc = ""]
9863 #[doc = " where ::cudaExternalSemaphoreHandleDesc::type specifies the type of"]
9864 #[doc = " handle being imported. ::cudaExternalSemaphoreHandleType is defined"]
9865 #[doc = " as:"]
9866 #[doc = ""]
9867 #[doc = " \\code"]
9868 #[doc = "typedef enum cudaExternalSemaphoreHandleType_enum {"]
9869 #[doc = "cudaExternalSemaphoreHandleTypeOpaqueFd = 1,"]
9870 #[doc = "cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2,"]
9871 #[doc = "cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3,"]
9872 #[doc = "cudaExternalSemaphoreHandleTypeD3D12Fence = 4,"]
9873 #[doc = "cudaExternalSemaphoreHandleTypeD3D11Fence = 5,"]
9874 #[doc = "cudaExternalSemaphoreHandleTypeNvSciSync = 6,"]
9875 #[doc = "cudaExternalSemaphoreHandleTypeKeyedMutex = 7,"]
9876 #[doc = "cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8,"]
9877 #[doc = "cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9,"]
9878 #[doc = "cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10"]
9879 #[doc = "} cudaExternalSemaphoreHandleType;"]
9880 #[doc = " \\endcode"]
9881 #[doc = ""]
9882 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9883 #[doc = " ::cudaExternalSemaphoreHandleTypeOpaqueFd, then"]
9884 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::fd must be a valid file"]
9885 #[doc = " descriptor referencing a synchronization object. Ownership of the"]
9886 #[doc = " file descriptor is transferred to the CUDA driver when the handle"]
9887 #[doc = " is imported successfully. Performing any operations on the file"]
9888 #[doc = " descriptor after it is imported results in undefined behavior."]
9889 #[doc = ""]
9890 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9891 #[doc = " ::cudaExternalSemaphoreHandleTypeOpaqueWin32, then exactly one of"]
9892 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle and"]
9893 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name must not be"]
9894 #[doc = " NULL. If ::cudaExternalSemaphoreHandleDesc::handle::win32::handle"]
9895 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9896 #[doc = " references a synchronization object. Ownership of this handle is"]
9897 #[doc = " not transferred to CUDA after the import operation, so the"]
9898 #[doc = " application must release the handle using the appropriate system"]
9899 #[doc = " call. If ::cudaExternalSemaphoreHandleDesc::handle::win32::name is"]
9900 #[doc = " not NULL, then it must name a valid synchronization object."]
9901 #[doc = ""]
9902 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9903 #[doc = " ::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt, then"]
9904 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle must be"]
9905 #[doc = " non-NULL and ::cudaExternalSemaphoreHandleDesc::handle::win32::name"]
9906 #[doc = " must be NULL. The handle specified must be a globally shared KMT"]
9907 #[doc = " handle. This handle does not hold a reference to the underlying"]
9908 #[doc = " object, and thus will be invalid when all references to the"]
9909 #[doc = " synchronization object are destroyed."]
9910 #[doc = ""]
9911 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9912 #[doc = " ::cudaExternalSemaphoreHandleTypeD3D12Fence, then exactly one of"]
9913 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle and"]
9914 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name must not be"]
9915 #[doc = " NULL. If ::cudaExternalSemaphoreHandleDesc::handle::win32::handle"]
9916 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9917 #[doc = " is returned by ID3D12Device::CreateSharedHandle when referring to a"]
9918 #[doc = " ID3D12Fence object. This handle holds a reference to the underlying"]
9919 #[doc = " object. If ::cudaExternalSemaphoreHandleDesc::handle::win32::name"]
9920 #[doc = " is not NULL, then it must name a valid synchronization object that"]
9921 #[doc = " refers to a valid ID3D12Fence object."]
9922 #[doc = ""]
9923 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9924 #[doc = " ::cudaExternalSemaphoreHandleTypeD3D11Fence, then exactly one of"]
9925 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle and"]
9926 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name must not be"]
9927 #[doc = " NULL. If ::cudaExternalSemaphoreHandleDesc::handle::win32::handle"]
9928 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9929 #[doc = " is returned by ID3D11Fence::CreateSharedHandle. If"]
9930 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name"]
9931 #[doc = " is not NULL, then it must name a valid synchronization object that"]
9932 #[doc = " refers to a valid ID3D11Fence object."]
9933 #[doc = ""]
9934 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9935 #[doc = " ::cudaExternalSemaphoreHandleTypeNvSciSync, then"]
9936 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::nvSciSyncObj"]
9937 #[doc = " represents a valid NvSciSyncObj."]
9938 #[doc = ""]
9939 #[doc = " ::cudaExternalSemaphoreHandleTypeKeyedMutex, then exactly one of"]
9940 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle and"]
9941 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name must not be"]
9942 #[doc = " NULL. If ::cudaExternalSemaphoreHandleDesc::handle::win32::handle"]
9943 #[doc = " is not NULL, then it represent a valid shared NT handle that"]
9944 #[doc = " is returned by IDXGIResource1::CreateSharedHandle when referring to"]
9945 #[doc = " a IDXGIKeyedMutex object."]
9946 #[doc = ""]
9947 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9948 #[doc = " ::cudaExternalSemaphoreHandleTypeKeyedMutexKmt, then"]
9949 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle must be"]
9950 #[doc = " non-NULL and ::cudaExternalSemaphoreHandleDesc::handle::win32::name"]
9951 #[doc = " must be NULL. The handle specified must represent a valid KMT"]
9952 #[doc = " handle that is returned by IDXGIResource::GetSharedHandle when"]
9953 #[doc = " referring to a IDXGIKeyedMutex object."]
9954 #[doc = ""]
9955 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9956 #[doc = " ::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd, then"]
9957 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::fd must be a valid file"]
9958 #[doc = " descriptor referencing a synchronization object. Ownership of the"]
9959 #[doc = " file descriptor is transferred to the CUDA driver when the handle"]
9960 #[doc = " is imported successfully. Performing any operations on the file"]
9961 #[doc = " descriptor after it is imported results in undefined behavior."]
9962 #[doc = ""]
9963 #[doc = " If ::cudaExternalSemaphoreHandleDesc::type is"]
9964 #[doc = " ::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32, then exactly one of"]
9965 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::handle and"]
9966 #[doc = " ::cudaExternalSemaphoreHandleDesc::handle::win32::name must not be"]
9967 #[doc = " NULL. If ::cudaExternalSemaphoreHandleDesc::handle::win32::handle"]
9968 #[doc = " is not NULL, then it must represent a valid shared NT handle that"]
9969 #[doc = " references a synchronization object. Ownership of this handle is"]
9970 #[doc = " not transferred to CUDA after the import operation, so the"]
9971 #[doc = " application must release the handle using the appropriate system"]
9972 #[doc = " call. If ::cudaExternalSemaphoreHandleDesc::handle::win32::name is"]
9973 #[doc = " not NULL, then it must name a valid synchronization object."]
9974 #[doc = ""]
9975 #[doc = " \\param extSem_out - Returned handle to an external semaphore"]
9976 #[doc = " \\param semHandleDesc - Semaphore import handle descriptor"]
9977 #[doc = ""]
9978 #[doc = " \\return"]
9979 #[doc = " ::cudaSuccess,"]
9980 #[doc = " ::cudaErrorInvalidResourceHandle"]
9981 #[doc = " \\notefnerr"]
9982 #[doc = " \\note_init_rt"]
9983 #[doc = " \\note_callback"]
9984 #[doc = ""]
9985 #[doc = " \\sa ::cudaDestroyExternalSemaphore,"]
9986 #[doc = " ::cudaSignalExternalSemaphoresAsync,"]
9987 #[doc = " ::cudaWaitExternalSemaphoresAsync"]
9988 pub fn cudaImportExternalSemaphore(
9989 extSem_out: *mut cudaExternalSemaphore_t,
9990 semHandleDesc: *const cudaExternalSemaphoreHandleDesc,
9991 ) -> cudaError_t;
9992}
9993extern "C" {
9994 pub fn cudaSignalExternalSemaphoresAsync_v2(
9995 extSemArray: *const cudaExternalSemaphore_t,
9996 paramsArray: *const cudaExternalSemaphoreSignalParams,
9997 numExtSems: ::libc::c_uint,
9998 stream: cudaStream_t,
9999 ) -> cudaError_t;
10000}
10001extern "C" {
10002 pub fn cudaWaitExternalSemaphoresAsync_v2(
10003 extSemArray: *const cudaExternalSemaphore_t,
10004 paramsArray: *const cudaExternalSemaphoreWaitParams,
10005 numExtSems: ::libc::c_uint,
10006 stream: cudaStream_t,
10007 ) -> cudaError_t;
10008}
10009extern "C" {
10010 #[doc = " \\brief Destroys an external semaphore"]
10011 #[doc = ""]
10012 #[doc = " Destroys an external semaphore object and releases any references"]
10013 #[doc = " to the underlying resource. Any outstanding signals or waits must"]
10014 #[doc = " have completed before the semaphore is destroyed."]
10015 #[doc = ""]
10016 #[doc = " \\param extSem - External semaphore to be destroyed"]
10017 #[doc = ""]
10018 #[doc = " \\return"]
10019 #[doc = " ::cudaSuccess,"]
10020 #[doc = " ::cudaErrorInvalidResourceHandle"]
10021 #[doc = " \\notefnerr"]
10022 #[doc = " \\note_init_rt"]
10023 #[doc = " \\note_callback"]
10024 #[doc = " \\note_destroy_ub"]
10025 #[doc = ""]
10026 #[doc = " \\sa ::cudaImportExternalSemaphore,"]
10027 #[doc = " ::cudaSignalExternalSemaphoresAsync,"]
10028 #[doc = " ::cudaWaitExternalSemaphoresAsync"]
10029 pub fn cudaDestroyExternalSemaphore(extSem: cudaExternalSemaphore_t) -> cudaError_t;
10030}
10031extern "C" {
10032 #[doc = " \\brief Launches a device function"]
10033 #[doc = ""]
10034 #[doc = " The function invokes kernel \\p func on \\p gridDim (\\p gridDim.x × \\p gridDim.y"]
10035 #[doc = " × \\p gridDim.z) grid of blocks. Each block contains \\p blockDim (\\p blockDim.x ×"]
10036 #[doc = " \\p blockDim.y × \\p blockDim.z) threads."]
10037 #[doc = ""]
10038 #[doc = " If the kernel has N parameters the \\p args should point to array of N pointers."]
10039 #[doc = " Each pointer, from <tt>args[0]</tt> to <tt>args[N - 1]</tt>, point to the region"]
10040 #[doc = " of memory from which the actual parameter will be copied."]
10041 #[doc = ""]
10042 #[doc = " For templated functions, pass the function symbol as follows:"]
10043 #[doc = " func_name<template_arg_0,...,template_arg_N>"]
10044 #[doc = ""]
10045 #[doc = " \\p sharedMem sets the amount of dynamic shared memory that will be available to"]
10046 #[doc = " each thread block."]
10047 #[doc = ""]
10048 #[doc = " \\p stream specifies a stream the invocation is associated to."]
10049 #[doc = ""]
10050 #[doc = " \\param func - Device function symbol"]
10051 #[doc = " \\param gridDim - Grid dimentions"]
10052 #[doc = " \\param blockDim - Block dimentions"]
10053 #[doc = " \\param args - Arguments"]
10054 #[doc = " \\param sharedMem - Shared memory"]
10055 #[doc = " \\param stream - Stream identifier"]
10056 #[doc = ""]
10057 #[doc = " \\return"]
10058 #[doc = " ::cudaSuccess,"]
10059 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10060 #[doc = " ::cudaErrorInvalidConfiguration,"]
10061 #[doc = " ::cudaErrorLaunchFailure,"]
10062 #[doc = " ::cudaErrorLaunchTimeout,"]
10063 #[doc = " ::cudaErrorLaunchOutOfResources,"]
10064 #[doc = " ::cudaErrorSharedObjectInitFailed,"]
10065 #[doc = " ::cudaErrorInvalidPtx,"]
10066 #[doc = " ::cudaErrorUnsupportedPtxVersion,"]
10067 #[doc = " ::cudaErrorNoKernelImageForDevice,"]
10068 #[doc = " ::cudaErrorJitCompilerNotFound,"]
10069 #[doc = " ::cudaErrorJitCompilationDisabled"]
10070 #[doc = " \\note_null_stream"]
10071 #[doc = " \\notefnerr"]
10072 #[doc = " \\note_init_rt"]
10073 #[doc = " \\note_callback"]
10074 #[doc = ""]
10075 #[doc = " \\sa"]
10076 #[doc = " \\ref ::cudaLaunchKernel(const T *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchKernel (C++ API)\","]
10077 #[doc = " ::cuLaunchKernel"]
10078 pub fn cudaLaunchKernel(
10079 func: *const ::libc::c_void,
10080 gridDim: dim3,
10081 blockDim: dim3,
10082 args: *mut *mut ::libc::c_void,
10083 sharedMem: usize,
10084 stream: cudaStream_t,
10085 ) -> cudaError_t;
10086}
10087extern "C" {
10088 #[doc = " \\brief Launches a device function where thread blocks can cooperate and synchronize as they execute"]
10089 #[doc = ""]
10090 #[doc = " The function invokes kernel \\p func on \\p gridDim (\\p gridDim.x × \\p gridDim.y"]
10091 #[doc = " × \\p gridDim.z) grid of blocks. Each block contains \\p blockDim (\\p blockDim.x ×"]
10092 #[doc = " \\p blockDim.y × \\p blockDim.z) threads."]
10093 #[doc = ""]
10094 #[doc = " The device on which this kernel is invoked must have a non-zero value for"]
10095 #[doc = " the device attribute ::cudaDevAttrCooperativeLaunch."]
10096 #[doc = ""]
10097 #[doc = " The total number of blocks launched cannot exceed the maximum number of blocks per"]
10098 #[doc = " multiprocessor as returned by ::cudaOccupancyMaxActiveBlocksPerMultiprocessor (or"]
10099 #[doc = " ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors"]
10100 #[doc = " as specified by the device attribute ::cudaDevAttrMultiProcessorCount."]
10101 #[doc = ""]
10102 #[doc = " The kernel cannot make use of CUDA dynamic parallelism."]
10103 #[doc = ""]
10104 #[doc = " If the kernel has N parameters the \\p args should point to array of N pointers."]
10105 #[doc = " Each pointer, from <tt>args[0]</tt> to <tt>args[N - 1]</tt>, point to the region"]
10106 #[doc = " of memory from which the actual parameter will be copied."]
10107 #[doc = ""]
10108 #[doc = " For templated functions, pass the function symbol as follows:"]
10109 #[doc = " func_name<template_arg_0,...,template_arg_N>"]
10110 #[doc = ""]
10111 #[doc = " \\p sharedMem sets the amount of dynamic shared memory that will be available to"]
10112 #[doc = " each thread block."]
10113 #[doc = ""]
10114 #[doc = " \\p stream specifies a stream the invocation is associated to."]
10115 #[doc = ""]
10116 #[doc = " \\param func - Device function symbol"]
10117 #[doc = " \\param gridDim - Grid dimentions"]
10118 #[doc = " \\param blockDim - Block dimentions"]
10119 #[doc = " \\param args - Arguments"]
10120 #[doc = " \\param sharedMem - Shared memory"]
10121 #[doc = " \\param stream - Stream identifier"]
10122 #[doc = ""]
10123 #[doc = " \\return"]
10124 #[doc = " ::cudaSuccess,"]
10125 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10126 #[doc = " ::cudaErrorInvalidConfiguration,"]
10127 #[doc = " ::cudaErrorLaunchFailure,"]
10128 #[doc = " ::cudaErrorLaunchTimeout,"]
10129 #[doc = " ::cudaErrorLaunchOutOfResources,"]
10130 #[doc = " ::cudaErrorCooperativeLaunchTooLarge,"]
10131 #[doc = " ::cudaErrorSharedObjectInitFailed"]
10132 #[doc = " \\note_null_stream"]
10133 #[doc = " \\notefnerr"]
10134 #[doc = " \\note_init_rt"]
10135 #[doc = " \\note_callback"]
10136 #[doc = ""]
10137 #[doc = " \\sa"]
10138 #[doc = " \\ref ::cudaLaunchCooperativeKernel(const T *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchCooperativeKernel (C++ API)\","]
10139 #[doc = " ::cudaLaunchCooperativeKernelMultiDevice,"]
10140 #[doc = " ::cuLaunchCooperativeKernel"]
10141 pub fn cudaLaunchCooperativeKernel(
10142 func: *const ::libc::c_void,
10143 gridDim: dim3,
10144 blockDim: dim3,
10145 args: *mut *mut ::libc::c_void,
10146 sharedMem: usize,
10147 stream: cudaStream_t,
10148 ) -> cudaError_t;
10149}
10150extern "C" {
10151 #[doc = " \\brief Launches device functions on multiple devices where thread blocks can cooperate and synchronize as they execute"]
10152 #[doc = ""]
10153 #[doc = " \\deprecated This function is deprecated as of CUDA 11.3."]
10154 #[doc = ""]
10155 #[doc = " Invokes kernels as specified in the \\p launchParamsList array where each element"]
10156 #[doc = " of the array specifies all the parameters required to perform a single kernel launch."]
10157 #[doc = " These kernels can cooperate and synchronize as they execute. The size of the array is"]
10158 #[doc = " specified by \\p numDevices."]
10159 #[doc = ""]
10160 #[doc = " No two kernels can be launched on the same device. All the devices targeted by this"]
10161 #[doc = " multi-device launch must be identical. All devices must have a non-zero value for the"]
10162 #[doc = " device attribute ::cudaDevAttrCooperativeMultiDeviceLaunch."]
10163 #[doc = ""]
10164 #[doc = " The same kernel must be launched on all devices. Note that any __device__ or __constant__"]
10165 #[doc = " variables are independently instantiated on every device. It is the application's"]
10166 #[doc = " responsiblity to ensure these variables are initialized and used appropriately."]
10167 #[doc = ""]
10168 #[doc = " The size of the grids as specified in blocks, the size of the blocks themselves and the"]
10169 #[doc = " amount of shared memory used by each thread block must also match across all launched kernels."]
10170 #[doc = ""]
10171 #[doc = " The streams used to launch these kernels must have been created via either ::cudaStreamCreate"]
10172 #[doc = " or ::cudaStreamCreateWithPriority or ::cudaStreamCreateWithPriority. The NULL stream or"]
10173 #[doc = " ::cudaStreamLegacy or ::cudaStreamPerThread cannot be used."]
10174 #[doc = ""]
10175 #[doc = " The total number of blocks launched per kernel cannot exceed the maximum number of blocks"]
10176 #[doc = " per multiprocessor as returned by ::cudaOccupancyMaxActiveBlocksPerMultiprocessor (or"]
10177 #[doc = " ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags) times the number of multiprocessors"]
10178 #[doc = " as specified by the device attribute ::cudaDevAttrMultiProcessorCount. Since the"]
10179 #[doc = " total number of blocks launched per device has to match across all devices, the maximum"]
10180 #[doc = " number of blocks that can be launched per device will be limited by the device with the"]
10181 #[doc = " least number of multiprocessors."]
10182 #[doc = ""]
10183 #[doc = " The kernel cannot make use of CUDA dynamic parallelism."]
10184 #[doc = ""]
10185 #[doc = " The ::cudaLaunchParams structure is defined as:"]
10186 #[doc = " \\code"]
10187 #[doc = "struct cudaLaunchParams"]
10188 #[doc = "{"]
10189 #[doc = "void *func;"]
10190 #[doc = "dim3 gridDim;"]
10191 #[doc = "dim3 blockDim;"]
10192 #[doc = "void **args;"]
10193 #[doc = "size_t sharedMem;"]
10194 #[doc = "cudaStream_t stream;"]
10195 #[doc = "};"]
10196 #[doc = " \\endcode"]
10197 #[doc = " where:"]
10198 #[doc = " - ::cudaLaunchParams::func specifies the kernel to be launched. This same functions must"]
10199 #[doc = " be launched on all devices. For templated functions, pass the function symbol as follows:"]
10200 #[doc = " func_name<template_arg_0,...,template_arg_N>"]
10201 #[doc = " - ::cudaLaunchParams::gridDim specifies the width, height and depth of the grid in blocks."]
10202 #[doc = " This must match across all kernels launched."]
10203 #[doc = " - ::cudaLaunchParams::blockDim is the width, height and depth of each thread block. This"]
10204 #[doc = " must match across all kernels launched."]
10205 #[doc = " - ::cudaLaunchParams::args specifies the arguments to the kernel. If the kernel has"]
10206 #[doc = " N parameters then ::cudaLaunchParams::args should point to array of N pointers. Each"]
10207 #[doc = " pointer, from <tt>::cudaLaunchParams::args[0]</tt> to <tt>::cudaLaunchParams::args[N - 1]</tt>,"]
10208 #[doc = " point to the region of memory from which the actual parameter will be copied."]
10209 #[doc = " - ::cudaLaunchParams::sharedMem is the dynamic shared-memory size per thread block in bytes."]
10210 #[doc = " This must match across all kernels launched."]
10211 #[doc = " - ::cudaLaunchParams::stream is the handle to the stream to perform the launch in. This cannot"]
10212 #[doc = " be the NULL stream or ::cudaStreamLegacy or ::cudaStreamPerThread."]
10213 #[doc = ""]
10214 #[doc = " By default, the kernel won't begin execution on any GPU until all prior work in all the specified"]
10215 #[doc = " streams has completed. This behavior can be overridden by specifying the flag"]
10216 #[doc = " ::cudaCooperativeLaunchMultiDeviceNoPreSync. When this flag is specified, each kernel"]
10217 #[doc = " will only wait for prior work in the stream corresponding to that GPU to complete before it begins"]
10218 #[doc = " execution."]
10219 #[doc = ""]
10220 #[doc = " Similarly, by default, any subsequent work pushed in any of the specified streams will not begin"]
10221 #[doc = " execution until the kernels on all GPUs have completed. This behavior can be overridden by specifying"]
10222 #[doc = " the flag ::cudaCooperativeLaunchMultiDeviceNoPostSync. When this flag is specified,"]
10223 #[doc = " any subsequent work pushed in any of the specified streams will only wait for the kernel launched"]
10224 #[doc = " on the GPU corresponding to that stream to complete before it begins execution."]
10225 #[doc = ""]
10226 #[doc = " \\param launchParamsList - List of launch parameters, one per device"]
10227 #[doc = " \\param numDevices - Size of the \\p launchParamsList array"]
10228 #[doc = " \\param flags - Flags to control launch behavior"]
10229 #[doc = ""]
10230 #[doc = " \\return"]
10231 #[doc = " ::cudaSuccess,"]
10232 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10233 #[doc = " ::cudaErrorInvalidConfiguration,"]
10234 #[doc = " ::cudaErrorLaunchFailure,"]
10235 #[doc = " ::cudaErrorLaunchTimeout,"]
10236 #[doc = " ::cudaErrorLaunchOutOfResources,"]
10237 #[doc = " ::cudaErrorCooperativeLaunchTooLarge,"]
10238 #[doc = " ::cudaErrorSharedObjectInitFailed"]
10239 #[doc = " \\note_null_stream"]
10240 #[doc = " \\notefnerr"]
10241 #[doc = " \\note_init_rt"]
10242 #[doc = " \\note_callback"]
10243 #[doc = ""]
10244 #[doc = " \\sa"]
10245 #[doc = " \\ref ::cudaLaunchCooperativeKernel(const T *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchCooperativeKernel (C++ API)\","]
10246 #[doc = " ::cudaLaunchCooperativeKernel,"]
10247 #[doc = " ::cuLaunchCooperativeKernelMultiDevice"]
10248 pub fn cudaLaunchCooperativeKernelMultiDevice(
10249 launchParamsList: *mut cudaLaunchParams,
10250 numDevices: ::libc::c_uint,
10251 flags: ::libc::c_uint,
10252 ) -> cudaError_t;
10253}
10254extern "C" {
10255 #[doc = " \\brief Sets the preferred cache configuration for a device function"]
10256 #[doc = ""]
10257 #[doc = " On devices where the L1 cache and shared memory use the same hardware"]
10258 #[doc = " resources, this sets through \\p cacheConfig the preferred cache configuration"]
10259 #[doc = " for the function specified via \\p func. This is only a preference. The"]
10260 #[doc = " runtime will use the requested configuration if possible, but it is free to"]
10261 #[doc = " choose a different configuration if required to execute \\p func."]
10262 #[doc = ""]
10263 #[doc = " \\p func is a device function symbol and must be declared as a"]
10264 #[doc = " \\c __global__ function. If the specified function does not exist,"]
10265 #[doc = " then ::cudaErrorInvalidDeviceFunction is returned. For templated functions,"]
10266 #[doc = " pass the function symbol as follows: func_name<template_arg_0,...,template_arg_N>"]
10267 #[doc = ""]
10268 #[doc = " This setting does nothing on devices where the size of the L1 cache and"]
10269 #[doc = " shared memory are fixed."]
10270 #[doc = ""]
10271 #[doc = " Launching a kernel with a different preference than the most recent"]
10272 #[doc = " preference setting may insert a device-side synchronization point."]
10273 #[doc = ""]
10274 #[doc = " The supported cache configurations are:"]
10275 #[doc = " - ::cudaFuncCachePreferNone: no preference for shared memory or L1 (default)"]
10276 #[doc = " - ::cudaFuncCachePreferShared: prefer larger shared memory and smaller L1 cache"]
10277 #[doc = " - ::cudaFuncCachePreferL1: prefer larger L1 cache and smaller shared memory"]
10278 #[doc = " - ::cudaFuncCachePreferEqual: prefer equal size L1 cache and shared memory"]
10279 #[doc = ""]
10280 #[doc = " \\param func - Device function symbol"]
10281 #[doc = " \\param cacheConfig - Requested cache configuration"]
10282 #[doc = ""]
10283 #[doc = " \\return"]
10284 #[doc = " ::cudaSuccess,"]
10285 #[doc = " ::cudaErrorInvalidDeviceFunction"]
10286 #[doc = " \\notefnerr"]
10287 #[doc = " \\note_string_api_deprecation2"]
10288 #[doc = " \\note_init_rt"]
10289 #[doc = " \\note_callback"]
10290 #[doc = ""]
10291 #[doc = " \\sa"]
10292 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\","]
10293 #[doc = " \\ref ::cudaFuncGetAttributes(struct cudaFuncAttributes*, const void*) \"cudaFuncGetAttributes (C API)\","]
10294 #[doc = " \\ref ::cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchKernel (C API)\","]
10295 #[doc = " ::cudaThreadGetCacheConfig,"]
10296 #[doc = " ::cudaThreadSetCacheConfig,"]
10297 #[doc = " ::cuFuncSetCacheConfig"]
10298 pub fn cudaFuncSetCacheConfig(
10299 func: *const ::libc::c_void,
10300 cacheConfig: cudaFuncCache,
10301 ) -> cudaError_t;
10302}
10303extern "C" {
10304 #[doc = " \\brief Sets the shared memory configuration for a device function"]
10305 #[doc = ""]
10306 #[doc = " On devices with configurable shared memory banks, this function will"]
10307 #[doc = " force all subsequent launches of the specified device function to have"]
10308 #[doc = " the given shared memory bank size configuration. On any given launch of the"]
10309 #[doc = " function, the shared memory configuration of the device will be temporarily"]
10310 #[doc = " changed if needed to suit the function's preferred configuration. Changes in"]
10311 #[doc = " shared memory configuration between subsequent launches of functions,"]
10312 #[doc = " may introduce a device side synchronization point."]
10313 #[doc = ""]
10314 #[doc = " Any per-function setting of shared memory bank size set via"]
10315 #[doc = " ::cudaFuncSetSharedMemConfig will override the device wide setting set by"]
10316 #[doc = " ::cudaDeviceSetSharedMemConfig."]
10317 #[doc = ""]
10318 #[doc = " Changing the shared memory bank size will not increase shared memory usage"]
10319 #[doc = " or affect occupancy of kernels, but may have major effects on performance."]
10320 #[doc = " Larger bank sizes will allow for greater potential bandwidth to shared memory,"]
10321 #[doc = " but will change what kinds of accesses to shared memory will result in bank"]
10322 #[doc = " conflicts."]
10323 #[doc = ""]
10324 #[doc = " This function will do nothing on devices with fixed shared memory bank size."]
10325 #[doc = ""]
10326 #[doc = " For templated functions, pass the function symbol as follows:"]
10327 #[doc = " func_name<template_arg_0,...,template_arg_N>"]
10328 #[doc = ""]
10329 #[doc = " The supported bank configurations are:"]
10330 #[doc = " - ::cudaSharedMemBankSizeDefault: use the device's shared memory configuration"]
10331 #[doc = " when launching this function."]
10332 #[doc = " - ::cudaSharedMemBankSizeFourByte: set shared memory bank width to be"]
10333 #[doc = " four bytes natively when launching this function."]
10334 #[doc = " - ::cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight"]
10335 #[doc = " bytes natively when launching this function."]
10336 #[doc = ""]
10337 #[doc = " \\param func - Device function symbol"]
10338 #[doc = " \\param config - Requested shared memory configuration"]
10339 #[doc = ""]
10340 #[doc = " \\return"]
10341 #[doc = " ::cudaSuccess,"]
10342 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10343 #[doc = " ::cudaErrorInvalidValue,"]
10344 #[doc = " \\notefnerr"]
10345 #[doc = " \\note_string_api_deprecation2"]
10346 #[doc = " \\note_init_rt"]
10347 #[doc = " \\note_callback"]
10348 #[doc = ""]
10349 #[doc = " \\sa ::cudaDeviceSetSharedMemConfig,"]
10350 #[doc = " ::cudaDeviceGetSharedMemConfig,"]
10351 #[doc = " ::cudaDeviceSetCacheConfig,"]
10352 #[doc = " ::cudaDeviceGetCacheConfig,"]
10353 #[doc = " ::cudaFuncSetCacheConfig,"]
10354 #[doc = " ::cuFuncSetSharedMemConfig"]
10355 pub fn cudaFuncSetSharedMemConfig(
10356 func: *const ::libc::c_void,
10357 config: cudaSharedMemConfig,
10358 ) -> cudaError_t;
10359}
10360extern "C" {
10361 #[doc = " \\brief Find out attributes for a given function"]
10362 #[doc = ""]
10363 #[doc = " This function obtains the attributes of a function specified via \\p func."]
10364 #[doc = " \\p func is a device function symbol and must be declared as a"]
10365 #[doc = " \\c __global__ function. The fetched attributes are placed in \\p attr."]
10366 #[doc = " If the specified function does not exist, then"]
10367 #[doc = " ::cudaErrorInvalidDeviceFunction is returned. For templated functions, pass"]
10368 #[doc = " the function symbol as follows: func_name<template_arg_0,...,template_arg_N>"]
10369 #[doc = ""]
10370 #[doc = " Note that some function attributes such as"]
10371 #[doc = " \\ref ::cudaFuncAttributes::maxThreadsPerBlock \"maxThreadsPerBlock\""]
10372 #[doc = " may vary based on the device that is currently being used."]
10373 #[doc = ""]
10374 #[doc = " \\param attr - Return pointer to function's attributes"]
10375 #[doc = " \\param func - Device function symbol"]
10376 #[doc = ""]
10377 #[doc = " \\return"]
10378 #[doc = " ::cudaSuccess,"]
10379 #[doc = " ::cudaErrorInvalidDeviceFunction"]
10380 #[doc = " \\notefnerr"]
10381 #[doc = " \\note_string_api_deprecation2"]
10382 #[doc = " \\note_init_rt"]
10383 #[doc = " \\note_callback"]
10384 #[doc = ""]
10385 #[doc = " \\sa"]
10386 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\","]
10387 #[doc = " \\ref ::cudaFuncGetAttributes(struct cudaFuncAttributes*, T*) \"cudaFuncGetAttributes (C++ API)\","]
10388 #[doc = " \\ref ::cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchKernel (C API)\","]
10389 #[doc = " ::cuFuncGetAttribute"]
10390 pub fn cudaFuncGetAttributes(
10391 attr: *mut cudaFuncAttributes,
10392 func: *const ::libc::c_void,
10393 ) -> cudaError_t;
10394}
10395extern "C" {
10396 #[doc = " \\brief Set attributes for a given function"]
10397 #[doc = ""]
10398 #[doc = " This function sets the attributes of a function specified via \\p func."]
10399 #[doc = " The parameter \\p func must be a pointer to a function that executes"]
10400 #[doc = " on the device. The parameter specified by \\p func must be declared as a \\p __global__"]
10401 #[doc = " function. The enumeration defined by \\p attr is set to the value defined by \\p value."]
10402 #[doc = " If the specified function does not exist, then ::cudaErrorInvalidDeviceFunction is returned."]
10403 #[doc = " If the specified attribute cannot be written, or if the value is incorrect,"]
10404 #[doc = " then ::cudaErrorInvalidValue is returned."]
10405 #[doc = ""]
10406 #[doc = " Valid values for \\p attr are:"]
10407 #[doc = " - ::cudaFuncAttributeMaxDynamicSharedMemorySize - The requested maximum size in bytes of dynamically-allocated shared memory. The sum of this value and the function attribute ::sharedSizeBytes"]
10408 #[doc = " cannot exceed the device attribute ::cudaDevAttrMaxSharedMemoryPerBlockOptin. The maximal size of requestable dynamic shared memory may differ by GPU architecture."]
10409 #[doc = " - ::cudaFuncAttributePreferredSharedMemoryCarveout - On devices where the L1 cache and shared memory use the same hardware resources,"]
10410 #[doc = " this sets the shared memory carveout preference, in percent of the total shared memory. See ::cudaDevAttrMaxSharedMemoryPerMultiprocessor."]
10411 #[doc = " This is only a hint, and the driver can choose a different ratio if required to execute the function."]
10412 #[doc = ""]
10413 #[doc = " \\param func - Function to get attributes of"]
10414 #[doc = " \\param attr - Attribute to set"]
10415 #[doc = " \\param value - Value to set"]
10416 #[doc = ""]
10417 #[doc = " \\return"]
10418 #[doc = " ::cudaSuccess,"]
10419 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10420 #[doc = " ::cudaErrorInvalidValue"]
10421 #[doc = " \\notefnerr"]
10422 #[doc = " \\note_init_rt"]
10423 #[doc = " \\note_callback"]
10424 #[doc = ""]
10425 #[doc = " \\ref ::cudaLaunchKernel(const T *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) \"cudaLaunchKernel (C++ API)\","]
10426 #[doc = " \\ref ::cudaFuncSetCacheConfig(T*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C++ API)\","]
10427 #[doc = " \\ref ::cudaFuncGetAttributes(struct cudaFuncAttributes*, const void*) \"cudaFuncGetAttributes (C API)\","]
10428 pub fn cudaFuncSetAttribute(
10429 func: *const ::libc::c_void,
10430 attr: cudaFuncAttribute,
10431 value: ::libc::c_int,
10432 ) -> cudaError_t;
10433}
10434extern "C" {
10435 #[doc = " \\brief Converts a double argument to be executed on a device"]
10436 #[doc = ""]
10437 #[doc = " \\param d - Double to convert"]
10438 #[doc = ""]
10439 #[doc = " \\deprecated This function is deprecated as of CUDA 7.5"]
10440 #[doc = ""]
10441 #[doc = " Converts the double value of \\p d to an internal float representation if"]
10442 #[doc = " the device does not support double arithmetic. If the device does natively"]
10443 #[doc = " support doubles, then this function does nothing."]
10444 #[doc = ""]
10445 #[doc = " \\return"]
10446 #[doc = " ::cudaSuccess"]
10447 #[doc = " \\notefnerr"]
10448 #[doc = " \\note_init_rt"]
10449 #[doc = " \\note_callback"]
10450 #[doc = ""]
10451 #[doc = " \\sa"]
10452 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\","]
10453 #[doc = " \\ref ::cudaFuncGetAttributes(struct cudaFuncAttributes*, const void*) \"cudaFuncGetAttributes (C API)\","]
10454 #[doc = " ::cudaSetDoubleForHost"]
10455 pub fn cudaSetDoubleForDevice(d: *mut f64) -> cudaError_t;
10456}
10457extern "C" {
10458 #[doc = " \\brief Converts a double argument after execution on a device"]
10459 #[doc = ""]
10460 #[doc = " \\deprecated This function is deprecated as of CUDA 7.5"]
10461 #[doc = ""]
10462 #[doc = " Converts the double value of \\p d from a potentially internal float"]
10463 #[doc = " representation if the device does not support double arithmetic. If the"]
10464 #[doc = " device does natively support doubles, then this function does nothing."]
10465 #[doc = ""]
10466 #[doc = " \\param d - Double to convert"]
10467 #[doc = ""]
10468 #[doc = " \\return"]
10469 #[doc = " ::cudaSuccess"]
10470 #[doc = " \\notefnerr"]
10471 #[doc = " \\note_init_rt"]
10472 #[doc = " \\note_callback"]
10473 #[doc = ""]
10474 #[doc = " \\sa"]
10475 #[doc = " \\ref ::cudaFuncSetCacheConfig(const void*, enum cudaFuncCache) \"cudaFuncSetCacheConfig (C API)\","]
10476 #[doc = " \\ref ::cudaFuncGetAttributes(struct cudaFuncAttributes*, const void*) \"cudaFuncGetAttributes (C API)\","]
10477 #[doc = " ::cudaSetDoubleForDevice"]
10478 pub fn cudaSetDoubleForHost(d: *mut f64) -> cudaError_t;
10479}
10480extern "C" {
10481 #[doc = " \\brief Enqueues a host function call in a stream"]
10482 #[doc = ""]
10483 #[doc = " Enqueues a host function to run in a stream. The function will be called"]
10484 #[doc = " after currently enqueued work and will block work added after it."]
10485 #[doc = ""]
10486 #[doc = " The host function must not make any CUDA API calls. Attempting to use a"]
10487 #[doc = " CUDA API may result in ::cudaErrorNotPermitted, but this is not required."]
10488 #[doc = " The host function must not perform any synchronization that may depend on"]
10489 #[doc = " outstanding CUDA work not mandated to run earlier. Host functions without a"]
10490 #[doc = " mandated order (such as in independent streams) execute in undefined order"]
10491 #[doc = " and may be serialized."]
10492 #[doc = ""]
10493 #[doc = " For the purposes of Unified Memory, execution makes a number of guarantees:"]
10494 #[doc = " <ul>"]
10495 #[doc = " <li>The stream is considered idle for the duration of the function's"]
10496 #[doc = " execution. Thus, for example, the function may always use memory attached"]
10497 #[doc = " to the stream it was enqueued in.</li>"]
10498 #[doc = " <li>The start of execution of the function has the same effect as"]
10499 #[doc = " synchronizing an event recorded in the same stream immediately prior to"]
10500 #[doc = " the function. It thus synchronizes streams which have been \"joined\""]
10501 #[doc = " prior to the function.</li>"]
10502 #[doc = " <li>Adding device work to any stream does not have the effect of making"]
10503 #[doc = " the stream active until all preceding host functions and stream callbacks"]
10504 #[doc = " have executed. Thus, for"]
10505 #[doc = " example, a function might use global attached memory even if work has"]
10506 #[doc = " been added to another stream, if the work has been ordered behind the"]
10507 #[doc = " function call with an event.</li>"]
10508 #[doc = " <li>Completion of the function does not cause a stream to become"]
10509 #[doc = " active except as described above. The stream will remain idle"]
10510 #[doc = " if no device work follows the function, and will remain idle across"]
10511 #[doc = " consecutive host functions or stream callbacks without device work in"]
10512 #[doc = " between. Thus, for example,"]
10513 #[doc = " stream synchronization can be done by signaling from a host function at the"]
10514 #[doc = " end of the stream.</li>"]
10515 #[doc = " </ul>"]
10516 #[doc = ""]
10517 #[doc = " Note that, in constrast to ::cuStreamAddCallback, the function will not be"]
10518 #[doc = " called in the event of an error in the CUDA context."]
10519 #[doc = ""]
10520 #[doc = " \\param hStream - Stream to enqueue function call in"]
10521 #[doc = " \\param fn - The function to call once preceding stream operations are complete"]
10522 #[doc = " \\param userData - User-specified data to be passed to the function"]
10523 #[doc = ""]
10524 #[doc = " \\return"]
10525 #[doc = " ::cudaSuccess,"]
10526 #[doc = " ::cudaErrorInvalidResourceHandle,"]
10527 #[doc = " ::cudaErrorInvalidValue,"]
10528 #[doc = " ::cudaErrorNotSupported"]
10529 #[doc = " \\note_null_stream"]
10530 #[doc = " \\notefnerr"]
10531 #[doc = " \\note_init_rt"]
10532 #[doc = " \\note_callback"]
10533 #[doc = ""]
10534 #[doc = " \\sa ::cudaStreamCreate,"]
10535 #[doc = " ::cudaStreamQuery,"]
10536 #[doc = " ::cudaStreamSynchronize,"]
10537 #[doc = " ::cudaStreamWaitEvent,"]
10538 #[doc = " ::cudaStreamDestroy,"]
10539 #[doc = " ::cudaMallocManaged,"]
10540 #[doc = " ::cudaStreamAttachMemAsync,"]
10541 #[doc = " ::cudaStreamAddCallback,"]
10542 #[doc = " ::cuLaunchHostFunc"]
10543 pub fn cudaLaunchHostFunc(
10544 stream: cudaStream_t,
10545 fn_: cudaHostFn_t,
10546 userData: *mut ::libc::c_void,
10547 ) -> cudaError_t;
10548}
10549extern "C" {
10550 #[doc = " \\brief Returns occupancy for a device function"]
10551 #[doc = ""]
10552 #[doc = " Returns in \\p *numBlocks the maximum number of active blocks per"]
10553 #[doc = " streaming multiprocessor for the device function."]
10554 #[doc = ""]
10555 #[doc = " \\param numBlocks - Returned occupancy"]
10556 #[doc = " \\param func - Kernel function for which occupancy is calculated"]
10557 #[doc = " \\param blockSize - Block size the kernel is intended to be launched with"]
10558 #[doc = " \\param dynamicSMemSize - Per-block dynamic shared memory usage intended, in bytes"]
10559 #[doc = ""]
10560 #[doc = " \\return"]
10561 #[doc = " ::cudaSuccess,"]
10562 #[doc = " ::cudaErrorInvalidDevice,"]
10563 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10564 #[doc = " ::cudaErrorInvalidValue,"]
10565 #[doc = " ::cudaErrorUnknown,"]
10566 #[doc = " \\notefnerr"]
10567 #[doc = " \\note_init_rt"]
10568 #[doc = " \\note_callback"]
10569 #[doc = ""]
10570 #[doc = " \\sa ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags,"]
10571 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSize(int*, int*, T, size_t, int) \"cudaOccupancyMaxPotentialBlockSize (C++ API)\","]
10572 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeWithFlags(int*, int*, T, size_t, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)\","]
10573 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMem(int*, int*, T, UnaryFunction, int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)\","]
10574 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(int*, int*, T, UnaryFunction, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)\","]
10575 #[doc = " \\ref ::cudaOccupancyAvailableDynamicSMemPerBlock(size_t*, T, int, int) \"cudaOccupancyAvailableDynamicSMemPerBlock (C++ API)\","]
10576 #[doc = " ::cuOccupancyMaxActiveBlocksPerMultiprocessor"]
10577 pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessor(
10578 numBlocks: *mut ::libc::c_int,
10579 func: *const ::libc::c_void,
10580 blockSize: ::libc::c_int,
10581 dynamicSMemSize: usize,
10582 ) -> cudaError_t;
10583}
10584extern "C" {
10585 #[doc = " \\brief Returns dynamic shared memory available per block when launching \\p numBlocks blocks on SM."]
10586 #[doc = ""]
10587 #[doc = " Returns in \\p *dynamicSmemSize the maximum size of dynamic shared memory to allow \\p numBlocks blocks per SM."]
10588 #[doc = ""]
10589 #[doc = " \\param dynamicSmemSize - Returned maximum dynamic shared memory"]
10590 #[doc = " \\param func - Kernel function for which occupancy is calculated"]
10591 #[doc = " \\param numBlocks - Number of blocks to fit on SM"]
10592 #[doc = " \\param blockSize - Size of the block"]
10593 #[doc = ""]
10594 #[doc = " \\return"]
10595 #[doc = " ::cudaSuccess,"]
10596 #[doc = " ::cudaErrorInvalidDevice,"]
10597 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10598 #[doc = " ::cudaErrorInvalidValue,"]
10599 #[doc = " ::cudaErrorUnknown,"]
10600 #[doc = " \\notefnerr"]
10601 #[doc = " \\note_init_rt"]
10602 #[doc = " \\note_callback"]
10603 #[doc = ""]
10604 #[doc = " \\sa ::cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags,"]
10605 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSize(int*, int*, T, size_t, int) \"cudaOccupancyMaxPotentialBlockSize (C++ API)\","]
10606 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeWithFlags(int*, int*, T, size_t, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)\","]
10607 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMem(int*, int*, T, UnaryFunction, int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)\","]
10608 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(int*, int*, T, UnaryFunction, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)\","]
10609 #[doc = " ::cudaOccupancyAvailableDynamicSMemPerBlock"]
10610 pub fn cudaOccupancyAvailableDynamicSMemPerBlock(
10611 dynamicSmemSize: *mut usize,
10612 func: *const ::libc::c_void,
10613 numBlocks: ::libc::c_int,
10614 blockSize: ::libc::c_int,
10615 ) -> cudaError_t;
10616}
10617extern "C" {
10618 #[doc = " \\brief Returns occupancy for a device function with the specified flags"]
10619 #[doc = ""]
10620 #[doc = " Returns in \\p *numBlocks the maximum number of active blocks per"]
10621 #[doc = " streaming multiprocessor for the device function."]
10622 #[doc = ""]
10623 #[doc = " The \\p flags parameter controls how special cases are handled. Valid flags include:"]
10624 #[doc = ""]
10625 #[doc = " - ::cudaOccupancyDefault: keeps the default behavior as"]
10626 #[doc = " ::cudaOccupancyMaxActiveBlocksPerMultiprocessor"]
10627 #[doc = ""]
10628 #[doc = " - ::cudaOccupancyDisableCachingOverride: This flag suppresses the default behavior"]
10629 #[doc = " on platform where global caching affects occupancy. On such platforms, if caching"]
10630 #[doc = " is enabled, but per-block SM resource usage would result in zero occupancy, the"]
10631 #[doc = " occupancy calculator will calculate the occupancy as if caching is disabled."]
10632 #[doc = " Setting this flag makes the occupancy calculator to return 0 in such cases."]
10633 #[doc = " More information can be found about this feature in the \"Unified L1/Texture Cache\""]
10634 #[doc = " section of the Maxwell tuning guide."]
10635 #[doc = ""]
10636 #[doc = " \\param numBlocks - Returned occupancy"]
10637 #[doc = " \\param func - Kernel function for which occupancy is calculated"]
10638 #[doc = " \\param blockSize - Block size the kernel is intended to be launched with"]
10639 #[doc = " \\param dynamicSMemSize - Per-block dynamic shared memory usage intended, in bytes"]
10640 #[doc = " \\param flags - Requested behavior for the occupancy calculator"]
10641 #[doc = ""]
10642 #[doc = " \\return"]
10643 #[doc = " ::cudaSuccess,"]
10644 #[doc = " ::cudaErrorInvalidDevice,"]
10645 #[doc = " ::cudaErrorInvalidDeviceFunction,"]
10646 #[doc = " ::cudaErrorInvalidValue,"]
10647 #[doc = " ::cudaErrorUnknown,"]
10648 #[doc = " \\notefnerr"]
10649 #[doc = " \\note_init_rt"]
10650 #[doc = " \\note_callback"]
10651 #[doc = ""]
10652 #[doc = " \\sa ::cudaOccupancyMaxActiveBlocksPerMultiprocessor,"]
10653 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSize(int*, int*, T, size_t, int) \"cudaOccupancyMaxPotentialBlockSize (C++ API)\","]
10654 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeWithFlags(int*, int*, T, size_t, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)\","]
10655 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMem(int*, int*, T, UnaryFunction, int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)\","]
10656 #[doc = " \\ref ::cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags(int*, int*, T, UnaryFunction, int, unsigned int) \"cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)\","]
10657 #[doc = " \\ref ::cudaOccupancyAvailableDynamicSMemPerBlock(size_t*, T, int, int) \"cudaOccupancyAvailableDynamicSMemPerBlock (C++ API)\","]
10658 #[doc = " ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"]
10659 pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
10660 numBlocks: *mut ::libc::c_int,
10661 func: *const ::libc::c_void,
10662 blockSize: ::libc::c_int,
10663 dynamicSMemSize: usize,
10664 flags: ::libc::c_uint,
10665 ) -> cudaError_t;
10666}
10667extern "C" {
10668 pub fn cudaMallocManaged(
10669 devPtr: *mut *mut ::libc::c_void,
10670 size: usize,
10671 flags: ::libc::c_uint,
10672 ) -> cudaError_t;
10673}
10674extern "C" {
10675 #[doc = " \\brief Allocate memory on the device"]
10676 #[doc = ""]
10677 #[doc = " Allocates \\p size bytes of linear memory on the device and returns in"]
10678 #[doc = " \\p *devPtr a pointer to the allocated memory. The allocated memory is"]
10679 #[doc = " suitably aligned for any kind of variable. The memory is not cleared."]
10680 #[doc = " ::cudaMalloc() returns ::cudaErrorMemoryAllocation in case of failure."]
10681 #[doc = ""]
10682 #[doc = " The device version of ::cudaFree cannot be used with a \\p *devPtr"]
10683 #[doc = " allocated using the host API, and vice versa."]
10684 #[doc = ""]
10685 #[doc = " \\param devPtr - Pointer to allocated device memory"]
10686 #[doc = " \\param size - Requested allocation size in bytes"]
10687 #[doc = ""]
10688 #[doc = " \\return"]
10689 #[doc = " ::cudaSuccess,"]
10690 #[doc = " ::cudaErrorInvalidValue,"]
10691 #[doc = " ::cudaErrorMemoryAllocation"]
10692 #[doc = " \\notefnerr"]
10693 #[doc = " \\note_init_rt"]
10694 #[doc = " \\note_callback"]
10695 #[doc = ""]
10696 #[doc = " \\sa ::cudaMallocPitch, ::cudaFree, ::cudaMallocArray, ::cudaFreeArray,"]
10697 #[doc = " ::cudaMalloc3D, ::cudaMalloc3DArray,"]
10698 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10699 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
10700 #[doc = " ::cuMemAlloc"]
10701 pub fn cudaMalloc(devPtr: *mut *mut ::libc::c_void, size: usize) -> cudaError_t;
10702}
10703extern "C" {
10704 #[doc = " \\brief Allocates page-locked memory on the host"]
10705 #[doc = ""]
10706 #[doc = " Allocates \\p size bytes of host memory that is page-locked and accessible"]
10707 #[doc = " to the device. The driver tracks the virtual memory ranges allocated with"]
10708 #[doc = " this function and automatically accelerates calls to functions such as"]
10709 #[doc = " ::cudaMemcpy*(). Since the memory can be accessed directly by the device,"]
10710 #[doc = " it can be read or written with much higher bandwidth than pageable memory"]
10711 #[doc = " obtained with functions such as ::malloc(). Allocating excessive amounts of"]
10712 #[doc = " memory with ::cudaMallocHost() may degrade system performance, since it"]
10713 #[doc = " reduces the amount of memory available to the system for paging. As a"]
10714 #[doc = " result, this function is best used sparingly to allocate staging areas for"]
10715 #[doc = " data exchange between host and device."]
10716 #[doc = ""]
10717 #[doc = " \\param ptr - Pointer to allocated host memory"]
10718 #[doc = " \\param size - Requested allocation size in bytes"]
10719 #[doc = ""]
10720 #[doc = " \\return"]
10721 #[doc = " ::cudaSuccess,"]
10722 #[doc = " ::cudaErrorInvalidValue,"]
10723 #[doc = " ::cudaErrorMemoryAllocation"]
10724 #[doc = " \\notefnerr"]
10725 #[doc = " \\note_init_rt"]
10726 #[doc = " \\note_callback"]
10727 #[doc = ""]
10728 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaMallocArray, ::cudaMalloc3D,"]
10729 #[doc = " ::cudaMalloc3DArray, ::cudaHostAlloc, ::cudaFree, ::cudaFreeArray,"]
10730 #[doc = " \\ref ::cudaMallocHost(void**, size_t, unsigned int) \"cudaMallocHost (C++ API)\","]
10731 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
10732 #[doc = " ::cuMemAllocHost"]
10733 pub fn cudaMallocHost(ptr: *mut *mut ::libc::c_void, size: usize) -> cudaError_t;
10734}
10735extern "C" {
10736 #[doc = " \\brief Allocates pitched memory on the device"]
10737 #[doc = ""]
10738 #[doc = " Allocates at least \\p width (in bytes) * \\p height bytes of linear memory"]
10739 #[doc = " on the device and returns in \\p *devPtr a pointer to the allocated memory."]
10740 #[doc = " The function may pad the allocation to ensure that corresponding pointers"]
10741 #[doc = " in any given row will continue to meet the alignment requirements for"]
10742 #[doc = " coalescing as the address is updated from row to row. The pitch returned in"]
10743 #[doc = " \\p *pitch by ::cudaMallocPitch() is the width in bytes of the allocation."]
10744 #[doc = " The intended usage of \\p pitch is as a separate parameter of the allocation,"]
10745 #[doc = " used to compute addresses within the 2D array. Given the row and column of"]
10746 #[doc = " an array element of type \\p T, the address is computed as:"]
10747 #[doc = " \\code"]
10748 #[doc = "T* pElement = (T*)((char*)BaseAddress + Row * pitch) + Column;"]
10749 #[doc = "\\endcode"]
10750 #[doc = ""]
10751 #[doc = " For allocations of 2D arrays, it is recommended that programmers consider"]
10752 #[doc = " performing pitch allocations using ::cudaMallocPitch(). Due to pitch"]
10753 #[doc = " alignment restrictions in the hardware, this is especially true if the"]
10754 #[doc = " application will be performing 2D memory copies between different regions"]
10755 #[doc = " of device memory (whether linear memory or CUDA arrays)."]
10756 #[doc = ""]
10757 #[doc = " \\param devPtr - Pointer to allocated pitched device memory"]
10758 #[doc = " \\param pitch - Pitch for allocation"]
10759 #[doc = " \\param width - Requested pitched allocation width (in bytes)"]
10760 #[doc = " \\param height - Requested pitched allocation height"]
10761 #[doc = ""]
10762 #[doc = " \\return"]
10763 #[doc = " ::cudaSuccess,"]
10764 #[doc = " ::cudaErrorInvalidValue,"]
10765 #[doc = " ::cudaErrorMemoryAllocation"]
10766 #[doc = " \\notefnerr"]
10767 #[doc = " \\note_init_rt"]
10768 #[doc = " \\note_callback"]
10769 #[doc = ""]
10770 #[doc = " \\sa ::cudaMalloc, ::cudaFree, ::cudaMallocArray, ::cudaFreeArray,"]
10771 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10772 #[doc = " ::cudaFreeHost, ::cudaMalloc3D, ::cudaMalloc3DArray,"]
10773 #[doc = " ::cudaHostAlloc,"]
10774 #[doc = " ::cuMemAllocPitch"]
10775 pub fn cudaMallocPitch(
10776 devPtr: *mut *mut ::libc::c_void,
10777 pitch: *mut usize,
10778 width: usize,
10779 height: usize,
10780 ) -> cudaError_t;
10781}
10782extern "C" {
10783 #[doc = " \\brief Allocate an array on the device"]
10784 #[doc = ""]
10785 #[doc = " Allocates a CUDA array according to the ::cudaChannelFormatDesc structure"]
10786 #[doc = " \\p desc and returns a handle to the new CUDA array in \\p *array."]
10787 #[doc = ""]
10788 #[doc = " The ::cudaChannelFormatDesc is defined as:"]
10789 #[doc = " \\code"]
10790 #[doc = "struct cudaChannelFormatDesc {"]
10791 #[doc = "int x, y, z, w;"]
10792 #[doc = "enum cudaChannelFormatKind f;"]
10793 #[doc = "};"]
10794 #[doc = "\\endcode"]
10795 #[doc = " where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned,"]
10796 #[doc = " ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat."]
10797 #[doc = ""]
10798 #[doc = " The \\p flags parameter enables different options to be specified that affect"]
10799 #[doc = " the allocation, as follows."]
10800 #[doc = " - ::cudaArrayDefault: This flag's value is defined to be 0 and provides default array allocation"]
10801 #[doc = " - ::cudaArraySurfaceLoadStore: Allocates an array that can be read from or written to using a surface reference"]
10802 #[doc = " - ::cudaArrayTextureGather: This flag indicates that texture gather operations will be performed on the array."]
10803 #[doc = " - ::cudaArraySparse: Allocates a CUDA array without physical backing memory. The subregions within this sparse array"]
10804 #[doc = " can later be mapped to physical memory by calling ::cuMemMapArrayAsync. The physical backing memory must be allocated"]
10805 #[doc = " via ::cuMemCreate."]
10806 #[doc = ""]
10807 #[doc = " \\p width and \\p height must meet certain size requirements. See ::cudaMalloc3DArray() for more details."]
10808 #[doc = ""]
10809 #[doc = " \\param array - Pointer to allocated array in device memory"]
10810 #[doc = " \\param desc - Requested channel format"]
10811 #[doc = " \\param width - Requested array allocation width"]
10812 #[doc = " \\param height - Requested array allocation height"]
10813 #[doc = " \\param flags - Requested properties of allocated array"]
10814 #[doc = ""]
10815 #[doc = " \\return"]
10816 #[doc = " ::cudaSuccess,"]
10817 #[doc = " ::cudaErrorInvalidValue,"]
10818 #[doc = " ::cudaErrorMemoryAllocation"]
10819 #[doc = " \\notefnerr"]
10820 #[doc = " \\note_init_rt"]
10821 #[doc = " \\note_callback"]
10822 #[doc = ""]
10823 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaFree, ::cudaFreeArray,"]
10824 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10825 #[doc = " ::cudaFreeHost, ::cudaMalloc3D, ::cudaMalloc3DArray,"]
10826 #[doc = " ::cudaHostAlloc,"]
10827 #[doc = " ::cuArrayCreate"]
10828 pub fn cudaMallocArray(
10829 array: *mut cudaArray_t,
10830 desc: *const cudaChannelFormatDesc,
10831 width: usize,
10832 height: usize,
10833 flags: ::libc::c_uint,
10834 ) -> cudaError_t;
10835}
10836extern "C" {
10837 #[doc = " \\brief Frees memory on the device"]
10838 #[doc = ""]
10839 #[doc = " Frees the memory space pointed to by \\p devPtr, which must have been"]
10840 #[doc = " returned by a previous call to ::cudaMalloc() or ::cudaMallocPitch()."]
10841 #[doc = " Otherwise, or if ::cudaFree(\\p devPtr) has already been called before,"]
10842 #[doc = " an error is returned. If \\p devPtr is 0, no operation is performed."]
10843 #[doc = " ::cudaFree() returns ::cudaErrorValue in case of failure."]
10844 #[doc = ""]
10845 #[doc = " The device version of ::cudaFree cannot be used with a \\p *devPtr"]
10846 #[doc = " allocated using the host API, and vice versa."]
10847 #[doc = ""]
10848 #[doc = " \\param devPtr - Device pointer to memory to free"]
10849 #[doc = ""]
10850 #[doc = " \\return"]
10851 #[doc = " ::cudaSuccess,"]
10852 #[doc = " ::cudaErrorInvalidValue"]
10853 #[doc = " \\notefnerr"]
10854 #[doc = " \\note_init_rt"]
10855 #[doc = " \\note_callback"]
10856 #[doc = ""]
10857 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaMallocArray, ::cudaFreeArray,"]
10858 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10859 #[doc = " ::cudaFreeHost, ::cudaMalloc3D, ::cudaMalloc3DArray,"]
10860 #[doc = " ::cudaHostAlloc,"]
10861 #[doc = " ::cuMemFree"]
10862 pub fn cudaFree(devPtr: *mut ::libc::c_void) -> cudaError_t;
10863}
10864extern "C" {
10865 #[doc = " \\brief Frees page-locked memory"]
10866 #[doc = ""]
10867 #[doc = " Frees the memory space pointed to by \\p hostPtr, which must have been"]
10868 #[doc = " returned by a previous call to ::cudaMallocHost() or ::cudaHostAlloc()."]
10869 #[doc = ""]
10870 #[doc = " \\param ptr - Pointer to memory to free"]
10871 #[doc = ""]
10872 #[doc = " \\return"]
10873 #[doc = " ::cudaSuccess,"]
10874 #[doc = " ::cudaErrorInvalidValue"]
10875 #[doc = " \\notefnerr"]
10876 #[doc = " \\note_init_rt"]
10877 #[doc = " \\note_callback"]
10878 #[doc = ""]
10879 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaFree, ::cudaMallocArray,"]
10880 #[doc = " ::cudaFreeArray,"]
10881 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10882 #[doc = " ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaHostAlloc,"]
10883 #[doc = " ::cuMemFreeHost"]
10884 pub fn cudaFreeHost(ptr: *mut ::libc::c_void) -> cudaError_t;
10885}
10886extern "C" {
10887 #[doc = " \\brief Frees an array on the device"]
10888 #[doc = ""]
10889 #[doc = " Frees the CUDA array \\p array, which must have been returned by a"]
10890 #[doc = " previous call to ::cudaMallocArray(). If \\p devPtr is 0,"]
10891 #[doc = " no operation is performed."]
10892 #[doc = ""]
10893 #[doc = " \\param array - Pointer to array to free"]
10894 #[doc = ""]
10895 #[doc = " \\return"]
10896 #[doc = " ::cudaSuccess,"]
10897 #[doc = " ::cudaErrorInvalidValue"]
10898 #[doc = " \\notefnerr"]
10899 #[doc = " \\note_init_rt"]
10900 #[doc = " \\note_callback"]
10901 #[doc = ""]
10902 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaFree, ::cudaMallocArray,"]
10903 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10904 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
10905 #[doc = " ::cuArrayDestroy"]
10906 pub fn cudaFreeArray(array: cudaArray_t) -> cudaError_t;
10907}
10908extern "C" {
10909 #[doc = " \\brief Frees a mipmapped array on the device"]
10910 #[doc = ""]
10911 #[doc = " Frees the CUDA mipmapped array \\p mipmappedArray, which must have been"]
10912 #[doc = " returned by a previous call to ::cudaMallocMipmappedArray(). If \\p devPtr"]
10913 #[doc = " is 0, no operation is performed."]
10914 #[doc = ""]
10915 #[doc = " \\param mipmappedArray - Pointer to mipmapped array to free"]
10916 #[doc = ""]
10917 #[doc = " \\return"]
10918 #[doc = " ::cudaSuccess,"]
10919 #[doc = " ::cudaErrorInvalidValue"]
10920 #[doc = " \\notefnerr"]
10921 #[doc = " \\note_init_rt"]
10922 #[doc = " \\note_callback"]
10923 #[doc = ""]
10924 #[doc = " \\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaFree, ::cudaMallocArray,"]
10925 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10926 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
10927 #[doc = " ::cuMipmappedArrayDestroy"]
10928 pub fn cudaFreeMipmappedArray(mipmappedArray: cudaMipmappedArray_t) -> cudaError_t;
10929}
10930extern "C" {
10931 #[doc = " \\brief Allocates page-locked memory on the host"]
10932 #[doc = ""]
10933 #[doc = " Allocates \\p size bytes of host memory that is page-locked and accessible"]
10934 #[doc = " to the device. The driver tracks the virtual memory ranges allocated with"]
10935 #[doc = " this function and automatically accelerates calls to functions such as"]
10936 #[doc = " ::cudaMemcpy(). Since the memory can be accessed directly by the device, it"]
10937 #[doc = " can be read or written with much higher bandwidth than pageable memory"]
10938 #[doc = " obtained with functions such as ::malloc(). Allocating excessive amounts of"]
10939 #[doc = " pinned memory may degrade system performance, since it reduces the amount"]
10940 #[doc = " of memory available to the system for paging. As a result, this function is"]
10941 #[doc = " best used sparingly to allocate staging areas for data exchange between host"]
10942 #[doc = " and device."]
10943 #[doc = ""]
10944 #[doc = " The \\p flags parameter enables different options to be specified that affect"]
10945 #[doc = " the allocation, as follows."]
10946 #[doc = " - ::cudaHostAllocDefault: This flag's value is defined to be 0 and causes"]
10947 #[doc = " ::cudaHostAlloc() to emulate ::cudaMallocHost()."]
10948 #[doc = " - ::cudaHostAllocPortable: The memory returned by this call will be"]
10949 #[doc = " considered as pinned memory by all CUDA contexts, not just the one that"]
10950 #[doc = " performed the allocation."]
10951 #[doc = " - ::cudaHostAllocMapped: Maps the allocation into the CUDA address space."]
10952 #[doc = " The device pointer to the memory may be obtained by calling"]
10953 #[doc = " ::cudaHostGetDevicePointer()."]
10954 #[doc = " - ::cudaHostAllocWriteCombined: Allocates the memory as write-combined (WC)."]
10955 #[doc = " WC memory can be transferred across the PCI Express bus more quickly on some"]
10956 #[doc = " system configurations, but cannot be read efficiently by most CPUs. WC"]
10957 #[doc = " memory is a good option for buffers that will be written by the CPU and read"]
10958 #[doc = " by the device via mapped pinned memory or host->device transfers."]
10959 #[doc = ""]
10960 #[doc = " All of these flags are orthogonal to one another: a developer may allocate"]
10961 #[doc = " memory that is portable, mapped and/or write-combined with no restrictions."]
10962 #[doc = ""]
10963 #[doc = " In order for the ::cudaHostAllocMapped flag to have any effect, the CUDA context"]
10964 #[doc = " must support the ::cudaDeviceMapHost flag, which can be checked via"]
10965 #[doc = " ::cudaGetDeviceFlags(). The ::cudaDeviceMapHost flag is implicitly set for"]
10966 #[doc = " contexts created via the runtime API."]
10967 #[doc = ""]
10968 #[doc = " The ::cudaHostAllocMapped flag may be specified on CUDA contexts for devices"]
10969 #[doc = " that do not support mapped pinned memory. The failure is deferred to"]
10970 #[doc = " ::cudaHostGetDevicePointer() because the memory may be mapped into other"]
10971 #[doc = " CUDA contexts via the ::cudaHostAllocPortable flag."]
10972 #[doc = ""]
10973 #[doc = " Memory allocated by this function must be freed with ::cudaFreeHost()."]
10974 #[doc = ""]
10975 #[doc = " \\param pHost - Device pointer to allocated memory"]
10976 #[doc = " \\param size - Requested allocation size in bytes"]
10977 #[doc = " \\param flags - Requested properties of allocated memory"]
10978 #[doc = ""]
10979 #[doc = " \\return"]
10980 #[doc = " ::cudaSuccess,"]
10981 #[doc = " ::cudaErrorInvalidValue,"]
10982 #[doc = " ::cudaErrorMemoryAllocation"]
10983 #[doc = " \\notefnerr"]
10984 #[doc = " \\note_init_rt"]
10985 #[doc = " \\note_callback"]
10986 #[doc = ""]
10987 #[doc = " \\sa ::cudaSetDeviceFlags,"]
10988 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
10989 #[doc = " ::cudaFreeHost,"]
10990 #[doc = " ::cudaGetDeviceFlags,"]
10991 #[doc = " ::cuMemHostAlloc"]
10992 pub fn cudaHostAlloc(
10993 pHost: *mut *mut ::libc::c_void,
10994 size: usize,
10995 flags: ::libc::c_uint,
10996 ) -> cudaError_t;
10997}
10998extern "C" {
10999 #[doc = " \\brief Registers an existing host memory range for use by CUDA"]
11000 #[doc = ""]
11001 #[doc = " Page-locks the memory range specified by \\p ptr and \\p size and maps it"]
11002 #[doc = " for the device(s) as specified by \\p flags. This memory range also is added"]
11003 #[doc = " to the same tracking mechanism as ::cudaHostAlloc() to automatically accelerate"]
11004 #[doc = " calls to functions such as ::cudaMemcpy(). Since the memory can be accessed"]
11005 #[doc = " directly by the device, it can be read or written with much higher bandwidth"]
11006 #[doc = " than pageable memory that has not been registered. Page-locking excessive"]
11007 #[doc = " amounts of memory may degrade system performance, since it reduces the amount"]
11008 #[doc = " of memory available to the system for paging. As a result, this function is"]
11009 #[doc = " best used sparingly to register staging areas for data exchange between"]
11010 #[doc = " host and device."]
11011 #[doc = ""]
11012 #[doc = " ::cudaHostRegister is supported only on I/O coherent devices that have a non-zero"]
11013 #[doc = " value for the device attribute ::cudaDevAttrHostRegisterSupported."]
11014 #[doc = ""]
11015 #[doc = " The \\p flags parameter enables different options to be specified that"]
11016 #[doc = " affect the allocation, as follows."]
11017 #[doc = ""]
11018 #[doc = " - ::cudaHostRegisterDefault: On a system with unified virtual addressing,"]
11019 #[doc = " the memory will be both mapped and portable. On a system with no unified"]
11020 #[doc = " virtual addressing, the memory will be neither mapped nor portable."]
11021 #[doc = ""]
11022 #[doc = " - ::cudaHostRegisterPortable: The memory returned by this call will be"]
11023 #[doc = " considered as pinned memory by all CUDA contexts, not just the one that"]
11024 #[doc = " performed the allocation."]
11025 #[doc = ""]
11026 #[doc = " - ::cudaHostRegisterMapped: Maps the allocation into the CUDA address"]
11027 #[doc = " space. The device pointer to the memory may be obtained by calling"]
11028 #[doc = " ::cudaHostGetDevicePointer()."]
11029 #[doc = ""]
11030 #[doc = " - ::cudaHostRegisterIoMemory: The passed memory pointer is treated as"]
11031 #[doc = " pointing to some memory-mapped I/O space, e.g. belonging to a"]
11032 #[doc = " third-party PCIe device, and it will marked as non cache-coherent and"]
11033 #[doc = " contiguous."]
11034 #[doc = ""]
11035 #[doc = " - ::cudaHostRegisterReadOnly: The passed memory pointer is treated as"]
11036 #[doc = " pointing to memory that is considered read-only by the device. On"]
11037 #[doc = " platforms without ::cudaDevAttrPageableMemoryAccessUsesHostPageTables, this"]
11038 #[doc = " flag is required in order to register memory mapped to the CPU as"]
11039 #[doc = " read-only. Support for the use of this flag can be queried from the device"]
11040 #[doc = " attribute cudaDeviceAttrReadOnlyHostRegisterSupported. Using this flag with"]
11041 #[doc = " a current context associated with a device that does not have this attribute"]
11042 #[doc = " set will cause ::cudaHostRegister to error with cudaErrorNotSupported."]
11043 #[doc = ""]
11044 #[doc = " All of these flags are orthogonal to one another: a developer may page-lock"]
11045 #[doc = " memory that is portable or mapped with no restrictions."]
11046 #[doc = ""]
11047 #[doc = " The CUDA context must have been created with the ::cudaMapHost flag in"]
11048 #[doc = " order for the ::cudaHostRegisterMapped flag to have any effect."]
11049 #[doc = ""]
11050 #[doc = " The ::cudaHostRegisterMapped flag may be specified on CUDA contexts for"]
11051 #[doc = " devices that do not support mapped pinned memory. The failure is deferred"]
11052 #[doc = " to ::cudaHostGetDevicePointer() because the memory may be mapped into"]
11053 #[doc = " other CUDA contexts via the ::cudaHostRegisterPortable flag."]
11054 #[doc = ""]
11055 #[doc = " For devices that have a non-zero value for the device attribute"]
11056 #[doc = " ::cudaDevAttrCanUseHostPointerForRegisteredMem, the memory"]
11057 #[doc = " can also be accessed from the device using the host pointer \\p ptr."]
11058 #[doc = " The device pointer returned by ::cudaHostGetDevicePointer() may or may not"]
11059 #[doc = " match the original host pointer \\p ptr and depends on the devices visible to the"]
11060 #[doc = " application. If all devices visible to the application have a non-zero value for the"]
11061 #[doc = " device attribute, the device pointer returned by ::cudaHostGetDevicePointer()"]
11062 #[doc = " will match the original pointer \\p ptr. If any device visible to the application"]
11063 #[doc = " has a zero value for the device attribute, the device pointer returned by"]
11064 #[doc = " ::cudaHostGetDevicePointer() will not match the original host pointer \\p ptr,"]
11065 #[doc = " but it will be suitable for use on all devices provided Unified Virtual Addressing"]
11066 #[doc = " is enabled. In such systems, it is valid to access the memory using either pointer"]
11067 #[doc = " on devices that have a non-zero value for the device attribute. Note however that"]
11068 #[doc = " such devices should access the memory using only of the two pointers and not both."]
11069 #[doc = ""]
11070 #[doc = " The memory page-locked by this function must be unregistered with ::cudaHostUnregister()."]
11071 #[doc = ""]
11072 #[doc = " \\param ptr - Host pointer to memory to page-lock"]
11073 #[doc = " \\param size - Size in bytes of the address range to page-lock in bytes"]
11074 #[doc = " \\param flags - Flags for allocation request"]
11075 #[doc = ""]
11076 #[doc = " \\return"]
11077 #[doc = " ::cudaSuccess,"]
11078 #[doc = " ::cudaErrorInvalidValue,"]
11079 #[doc = " ::cudaErrorMemoryAllocation,"]
11080 #[doc = " ::cudaErrorHostMemoryAlreadyRegistered,"]
11081 #[doc = " ::cudaErrorNotSupported"]
11082 #[doc = " \\notefnerr"]
11083 #[doc = " \\note_init_rt"]
11084 #[doc = " \\note_callback"]
11085 #[doc = ""]
11086 #[doc = " \\sa ::cudaHostUnregister, ::cudaHostGetFlags, ::cudaHostGetDevicePointer,"]
11087 #[doc = " ::cuMemHostRegister"]
11088 pub fn cudaHostRegister(
11089 ptr: *mut ::libc::c_void,
11090 size: usize,
11091 flags: ::libc::c_uint,
11092 ) -> cudaError_t;
11093}
11094extern "C" {
11095 #[doc = " \\brief Unregisters a memory range that was registered with cudaHostRegister"]
11096 #[doc = ""]
11097 #[doc = " Unmaps the memory range whose base address is specified by \\p ptr, and makes"]
11098 #[doc = " it pageable again."]
11099 #[doc = ""]
11100 #[doc = " The base address must be the same one specified to ::cudaHostRegister()."]
11101 #[doc = ""]
11102 #[doc = " \\param ptr - Host pointer to memory to unregister"]
11103 #[doc = ""]
11104 #[doc = " \\return"]
11105 #[doc = " ::cudaSuccess,"]
11106 #[doc = " ::cudaErrorInvalidValue,"]
11107 #[doc = " ::cudaErrorHostMemoryNotRegistered"]
11108 #[doc = " \\notefnerr"]
11109 #[doc = " \\note_init_rt"]
11110 #[doc = " \\note_callback"]
11111 #[doc = ""]
11112 #[doc = " \\sa ::cudaHostUnregister,"]
11113 #[doc = " ::cuMemHostUnregister"]
11114 pub fn cudaHostUnregister(ptr: *mut ::libc::c_void) -> cudaError_t;
11115}
11116extern "C" {
11117 #[doc = " \\brief Passes back device pointer of mapped host memory allocated by"]
11118 #[doc = " cudaHostAlloc or registered by cudaHostRegister"]
11119 #[doc = ""]
11120 #[doc = " Passes back the device pointer corresponding to the mapped, pinned host"]
11121 #[doc = " buffer allocated by ::cudaHostAlloc() or registered by ::cudaHostRegister()."]
11122 #[doc = ""]
11123 #[doc = " ::cudaHostGetDevicePointer() will fail if the ::cudaDeviceMapHost flag was"]
11124 #[doc = " not specified before deferred context creation occurred, or if called on a"]
11125 #[doc = " device that does not support mapped, pinned memory."]
11126 #[doc = ""]
11127 #[doc = " For devices that have a non-zero value for the device attribute"]
11128 #[doc = " ::cudaDevAttrCanUseHostPointerForRegisteredMem, the memory"]
11129 #[doc = " can also be accessed from the device using the host pointer \\p pHost."]
11130 #[doc = " The device pointer returned by ::cudaHostGetDevicePointer() may or may not"]
11131 #[doc = " match the original host pointer \\p pHost and depends on the devices visible to the"]
11132 #[doc = " application. If all devices visible to the application have a non-zero value for the"]
11133 #[doc = " device attribute, the device pointer returned by ::cudaHostGetDevicePointer()"]
11134 #[doc = " will match the original pointer \\p pHost. If any device visible to the application"]
11135 #[doc = " has a zero value for the device attribute, the device pointer returned by"]
11136 #[doc = " ::cudaHostGetDevicePointer() will not match the original host pointer \\p pHost,"]
11137 #[doc = " but it will be suitable for use on all devices provided Unified Virtual Addressing"]
11138 #[doc = " is enabled. In such systems, it is valid to access the memory using either pointer"]
11139 #[doc = " on devices that have a non-zero value for the device attribute. Note however that"]
11140 #[doc = " such devices should access the memory using only of the two pointers and not both."]
11141 #[doc = ""]
11142 #[doc = " \\p flags provides for future releases. For now, it must be set to 0."]
11143 #[doc = ""]
11144 #[doc = " \\param pDevice - Returned device pointer for mapped memory"]
11145 #[doc = " \\param pHost - Requested host pointer mapping"]
11146 #[doc = " \\param flags - Flags for extensions (must be 0 for now)"]
11147 #[doc = ""]
11148 #[doc = " \\return"]
11149 #[doc = " ::cudaSuccess,"]
11150 #[doc = " ::cudaErrorInvalidValue,"]
11151 #[doc = " ::cudaErrorMemoryAllocation"]
11152 #[doc = " \\notefnerr"]
11153 #[doc = " \\note_init_rt"]
11154 #[doc = " \\note_callback"]
11155 #[doc = ""]
11156 #[doc = " \\sa ::cudaSetDeviceFlags, ::cudaHostAlloc,"]
11157 #[doc = " ::cuMemHostGetDevicePointer"]
11158 pub fn cudaHostGetDevicePointer(
11159 pDevice: *mut *mut ::libc::c_void,
11160 pHost: *mut ::libc::c_void,
11161 flags: ::libc::c_uint,
11162 ) -> cudaError_t;
11163}
11164extern "C" {
11165 #[doc = " \\brief Passes back flags used to allocate pinned host memory allocated by"]
11166 #[doc = " cudaHostAlloc"]
11167 #[doc = ""]
11168 #[doc = " ::cudaHostGetFlags() will fail if the input pointer does not"]
11169 #[doc = " reside in an address range allocated by ::cudaHostAlloc()."]
11170 #[doc = ""]
11171 #[doc = " \\param pFlags - Returned flags word"]
11172 #[doc = " \\param pHost - Host pointer"]
11173 #[doc = ""]
11174 #[doc = " \\return"]
11175 #[doc = " ::cudaSuccess,"]
11176 #[doc = " ::cudaErrorInvalidValue"]
11177 #[doc = " \\notefnerr"]
11178 #[doc = " \\note_init_rt"]
11179 #[doc = " \\note_callback"]
11180 #[doc = ""]
11181 #[doc = " \\sa ::cudaHostAlloc,"]
11182 #[doc = " ::cuMemHostGetFlags"]
11183 pub fn cudaHostGetFlags(pFlags: *mut ::libc::c_uint, pHost: *mut ::libc::c_void)
11184 -> cudaError_t;
11185}
11186extern "C" {
11187 #[doc = " \\brief Allocates logical 1D, 2D, or 3D memory objects on the device"]
11188 #[doc = ""]
11189 #[doc = " Allocates at least \\p width * \\p height * \\p depth bytes of linear memory"]
11190 #[doc = " on the device and returns a ::cudaPitchedPtr in which \\p ptr is a pointer"]
11191 #[doc = " to the allocated memory. The function may pad the allocation to ensure"]
11192 #[doc = " hardware alignment requirements are met. The pitch returned in the \\p pitch"]
11193 #[doc = " field of \\p pitchedDevPtr is the width in bytes of the allocation."]
11194 #[doc = ""]
11195 #[doc = " The returned ::cudaPitchedPtr contains additional fields \\p xsize and"]
11196 #[doc = " \\p ysize, the logical width and height of the allocation, which are"]
11197 #[doc = " equivalent to the \\p width and \\p height \\p extent parameters provided by"]
11198 #[doc = " the programmer during allocation."]
11199 #[doc = ""]
11200 #[doc = " For allocations of 2D and 3D objects, it is highly recommended that"]
11201 #[doc = " programmers perform allocations using ::cudaMalloc3D() or"]
11202 #[doc = " ::cudaMallocPitch(). Due to alignment restrictions in the hardware, this is"]
11203 #[doc = " especially true if the application will be performing memory copies"]
11204 #[doc = " involving 2D or 3D objects (whether linear memory or CUDA arrays)."]
11205 #[doc = ""]
11206 #[doc = " \\param pitchedDevPtr - Pointer to allocated pitched device memory"]
11207 #[doc = " \\param extent - Requested allocation size (\\p width field in bytes)"]
11208 #[doc = ""]
11209 #[doc = " \\return"]
11210 #[doc = " ::cudaSuccess,"]
11211 #[doc = " ::cudaErrorInvalidValue,"]
11212 #[doc = " ::cudaErrorMemoryAllocation"]
11213 #[doc = " \\notefnerr"]
11214 #[doc = " \\note_init_rt"]
11215 #[doc = " \\note_callback"]
11216 #[doc = ""]
11217 #[doc = " \\sa ::cudaMallocPitch, ::cudaFree, ::cudaMemcpy3D, ::cudaMemset3D,"]
11218 #[doc = " ::cudaMalloc3DArray, ::cudaMallocArray, ::cudaFreeArray,"]
11219 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
11220 #[doc = " ::cudaFreeHost, ::cudaHostAlloc, ::make_cudaPitchedPtr, ::make_cudaExtent,"]
11221 #[doc = " ::cuMemAllocPitch"]
11222 pub fn cudaMalloc3D(pitchedDevPtr: *mut cudaPitchedPtr, extent: cudaExtent) -> cudaError_t;
11223}
11224extern "C" {
11225 #[doc = " \\brief Allocate an array on the device"]
11226 #[doc = ""]
11227 #[doc = " Allocates a CUDA array according to the ::cudaChannelFormatDesc structure"]
11228 #[doc = " \\p desc and returns a handle to the new CUDA array in \\p *array."]
11229 #[doc = ""]
11230 #[doc = " The ::cudaChannelFormatDesc is defined as:"]
11231 #[doc = " \\code"]
11232 #[doc = "struct cudaChannelFormatDesc {"]
11233 #[doc = "int x, y, z, w;"]
11234 #[doc = "enum cudaChannelFormatKind f;"]
11235 #[doc = "};"]
11236 #[doc = "\\endcode"]
11237 #[doc = " where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned,"]
11238 #[doc = " ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat."]
11239 #[doc = ""]
11240 #[doc = " ::cudaMalloc3DArray() can allocate the following:"]
11241 #[doc = ""]
11242 #[doc = " - A 1D array is allocated if the height and depth extents are both zero."]
11243 #[doc = " - A 2D array is allocated if only the depth extent is zero."]
11244 #[doc = " - A 3D array is allocated if all three extents are non-zero."]
11245 #[doc = " - A 1D layered CUDA array is allocated if only the height extent is zero and"]
11246 #[doc = " the cudaArrayLayered flag is set. Each layer is a 1D array. The number of layers is"]
11247 #[doc = " determined by the depth extent."]
11248 #[doc = " - A 2D layered CUDA array is allocated if all three extents are non-zero and"]
11249 #[doc = " the cudaArrayLayered flag is set. Each layer is a 2D array. The number of layers is"]
11250 #[doc = " determined by the depth extent."]
11251 #[doc = " - A cubemap CUDA array is allocated if all three extents are non-zero and the"]
11252 #[doc = " cudaArrayCubemap flag is set. Width must be equal to height, and depth must be six. A cubemap is"]
11253 #[doc = " a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube."]
11254 #[doc = " The order of the six layers in memory is the same as that listed in ::cudaGraphicsCubeFace."]
11255 #[doc = " - A cubemap layered CUDA array is allocated if all three extents are non-zero, and both,"]
11256 #[doc = " cudaArrayCubemap and cudaArrayLayered flags are set. Width must be equal to height, and depth must be"]
11257 #[doc = " a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists"]
11258 #[doc = " of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form"]
11259 #[doc = " the second cubemap, and so on."]
11260 #[doc = ""]
11261 #[doc = ""]
11262 #[doc = " The \\p flags parameter enables different options to be specified that affect"]
11263 #[doc = " the allocation, as follows."]
11264 #[doc = " - ::cudaArrayDefault: This flag's value is defined to be 0 and provides default array allocation"]
11265 #[doc = " - ::cudaArrayLayered: Allocates a layered CUDA array, with the depth extent indicating the number of layers"]
11266 #[doc = " - ::cudaArrayCubemap: Allocates a cubemap CUDA array. Width must be equal to height, and depth must be six."]
11267 #[doc = " If the cudaArrayLayered flag is also set, depth must be a multiple of six."]
11268 #[doc = " - ::cudaArraySurfaceLoadStore: Allocates a CUDA array that could be read from or written to using a surface"]
11269 #[doc = " reference."]
11270 #[doc = " - ::cudaArrayTextureGather: This flag indicates that texture gather operations will be performed on the CUDA"]
11271 #[doc = " array. Texture gather can only be performed on 2D CUDA arrays."]
11272 #[doc = " - ::cudaArraySparse: Allocates a CUDA array without physical backing memory. The subregions within this sparse array"]
11273 #[doc = " can later be mapped to physical memory by calling ::cuMemMapArrayAsync. This flag can only be used for"]
11274 #[doc = " creating 2D, 3D or 2D layered sparse CUDA arrays. The physical backing memory must be allocated via ::cuMemCreate."]
11275 #[doc = ""]
11276 #[doc = " The width, height and depth extents must meet certain size requirements as listed in the following table."]
11277 #[doc = " All values are specified in elements."]
11278 #[doc = ""]
11279 #[doc = " Note that 2D CUDA arrays have different size requirements if the ::cudaArrayTextureGather flag is set. In that"]
11280 #[doc = " case, the valid range for (width, height, depth) is ((1,maxTexture2DGather[0]), (1,maxTexture2DGather[1]), 0)."]
11281 #[doc = ""]
11282 #[doc = " \\xmlonly"]
11283 #[doc = " <table outputclass=\"xmlonly\">"]
11284 #[doc = " <tgroup cols=\"3\" colsep=\"1\" rowsep=\"1\">"]
11285 #[doc = " <colspec colname=\"c1\" colwidth=\"1.0*\"/>"]
11286 #[doc = " <colspec colname=\"c2\" colwidth=\"3.0*\"/>"]
11287 #[doc = " <colspec colname=\"c3\" colwidth=\"3.0*\"/>"]
11288 #[doc = " <thead>"]
11289 #[doc = " <row>"]
11290 #[doc = " <entry>CUDA array type</entry>"]
11291 #[doc = " <entry>Valid extents that must always be met {(width range in elements),"]
11292 #[doc = " (height range), (depth range)}</entry>"]
11293 #[doc = " <entry>Valid extents with cudaArraySurfaceLoadStore set {(width range in"]
11294 #[doc = " elements), (height range), (depth range)}</entry>"]
11295 #[doc = " </row>"]
11296 #[doc = " </thead>"]
11297 #[doc = " <tbody>"]
11298 #[doc = " <row>"]
11299 #[doc = " <entry>1D</entry>"]
11300 #[doc = " <entry>{ (1,maxTexture1D), 0, 0 }</entry>"]
11301 #[doc = " <entry>{ (1,maxSurface1D), 0, 0 }</entry>"]
11302 #[doc = " </row>"]
11303 #[doc = " <row>"]
11304 #[doc = " <entry>2D</entry>"]
11305 #[doc = " <entry>{ (1,maxTexture2D[0]), (1,maxTexture2D[1]), 0 }</entry>"]
11306 #[doc = " <entry>{ (1,maxSurface2D[0]), (1,maxSurface2D[1]), 0 }</entry>"]
11307 #[doc = " </row>"]
11308 #[doc = " <row>"]
11309 #[doc = " <entry>3D</entry>"]
11310 #[doc = " <entry>{ (1,maxTexture3D[0]), (1,maxTexture3D[1]), (1,maxTexture3D[2]) }"]
11311 #[doc = " OR { (1,maxTexture3DAlt[0]), (1,maxTexture3DAlt[1]),"]
11312 #[doc = " (1,maxTexture3DAlt[2]) }</entry>"]
11313 #[doc = " <entry>{ (1,maxSurface3D[0]), (1,maxSurface3D[1]), (1,maxSurface3D[2]) }</entry>"]
11314 #[doc = " </row>"]
11315 #[doc = " <row>"]
11316 #[doc = " <entry>1D Layered</entry>"]
11317 #[doc = " <entry>{ (1,maxTexture1DLayered[0]), 0, (1,maxTexture1DLayered[1]) }</entry>"]
11318 #[doc = " <entry>{ (1,maxSurface1DLayered[0]), 0, (1,maxSurface1DLayered[1]) }</entry>"]
11319 #[doc = " </row>"]
11320 #[doc = " <row>"]
11321 #[doc = " <entry>2D Layered</entry>"]
11322 #[doc = " <entry>{ (1,maxTexture2DLayered[0]), (1,maxTexture2DLayered[1]),"]
11323 #[doc = " (1,maxTexture2DLayered[2]) }</entry>"]
11324 #[doc = " <entry>{ (1,maxSurface2DLayered[0]), (1,maxSurface2DLayered[1]),"]
11325 #[doc = " (1,maxSurface2DLayered[2]) }</entry>"]
11326 #[doc = " </row>"]
11327 #[doc = " <row>"]
11328 #[doc = " <entry>Cubemap</entry>"]
11329 #[doc = " <entry>{ (1,maxTextureCubemap), (1,maxTextureCubemap), 6 }</entry>"]
11330 #[doc = " <entry>{ (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 }</entry>"]
11331 #[doc = " </row>"]
11332 #[doc = " <row>"]
11333 #[doc = " <entry>Cubemap Layered</entry>"]
11334 #[doc = " <entry>{ (1,maxTextureCubemapLayered[0]), (1,maxTextureCubemapLayered[0]),"]
11335 #[doc = " (1,maxTextureCubemapLayered[1]) }</entry>"]
11336 #[doc = " <entry>{ (1,maxSurfaceCubemapLayered[0]), (1,maxSurfaceCubemapLayered[0]),"]
11337 #[doc = " (1,maxSurfaceCubemapLayered[1]) }</entry>"]
11338 #[doc = " </row>"]
11339 #[doc = " </tbody>"]
11340 #[doc = " </tgroup>"]
11341 #[doc = " </table>"]
11342 #[doc = " \\endxmlonly"]
11343 #[doc = ""]
11344 #[doc = " \\param array - Pointer to allocated array in device memory"]
11345 #[doc = " \\param desc - Requested channel format"]
11346 #[doc = " \\param extent - Requested allocation size (\\p width field in elements)"]
11347 #[doc = " \\param flags - Flags for extensions"]
11348 #[doc = ""]
11349 #[doc = " \\return"]
11350 #[doc = " ::cudaSuccess,"]
11351 #[doc = " ::cudaErrorInvalidValue,"]
11352 #[doc = " ::cudaErrorMemoryAllocation"]
11353 #[doc = " \\notefnerr"]
11354 #[doc = " \\note_init_rt"]
11355 #[doc = " \\note_callback"]
11356 #[doc = ""]
11357 #[doc = " \\sa ::cudaMalloc3D, ::cudaMalloc, ::cudaMallocPitch, ::cudaFree,"]
11358 #[doc = " ::cudaFreeArray,"]
11359 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
11360 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
11361 #[doc = " ::make_cudaExtent,"]
11362 #[doc = " ::cuArray3DCreate"]
11363 pub fn cudaMalloc3DArray(
11364 array: *mut cudaArray_t,
11365 desc: *const cudaChannelFormatDesc,
11366 extent: cudaExtent,
11367 flags: ::libc::c_uint,
11368 ) -> cudaError_t;
11369}
11370extern "C" {
11371 #[doc = " \\brief Allocate a mipmapped array on the device"]
11372 #[doc = ""]
11373 #[doc = " Allocates a CUDA mipmapped array according to the ::cudaChannelFormatDesc structure"]
11374 #[doc = " \\p desc and returns a handle to the new CUDA mipmapped array in \\p *mipmappedArray."]
11375 #[doc = " \\p numLevels specifies the number of mipmap levels to be allocated. This value is"]
11376 #[doc = " clamped to the range [1, 1 + floor(log2(max(width, height, depth)))]."]
11377 #[doc = ""]
11378 #[doc = " The ::cudaChannelFormatDesc is defined as:"]
11379 #[doc = " \\code"]
11380 #[doc = "struct cudaChannelFormatDesc {"]
11381 #[doc = "int x, y, z, w;"]
11382 #[doc = "enum cudaChannelFormatKind f;"]
11383 #[doc = "};"]
11384 #[doc = "\\endcode"]
11385 #[doc = " where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned,"]
11386 #[doc = " ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat."]
11387 #[doc = ""]
11388 #[doc = " ::cudaMallocMipmappedArray() can allocate the following:"]
11389 #[doc = ""]
11390 #[doc = " - A 1D mipmapped array is allocated if the height and depth extents are both zero."]
11391 #[doc = " - A 2D mipmapped array is allocated if only the depth extent is zero."]
11392 #[doc = " - A 3D mipmapped array is allocated if all three extents are non-zero."]
11393 #[doc = " - A 1D layered CUDA mipmapped array is allocated if only the height extent is zero and"]
11394 #[doc = " the cudaArrayLayered flag is set. Each layer is a 1D mipmapped array. The number of layers is"]
11395 #[doc = " determined by the depth extent."]
11396 #[doc = " - A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and"]
11397 #[doc = " the cudaArrayLayered flag is set. Each layer is a 2D mipmapped array. The number of layers is"]
11398 #[doc = " determined by the depth extent."]
11399 #[doc = " - A cubemap CUDA mipmapped array is allocated if all three extents are non-zero and the"]
11400 #[doc = " cudaArrayCubemap flag is set. Width must be equal to height, and depth must be six."]
11401 #[doc = " The order of the six layers in memory is the same as that listed in ::cudaGraphicsCubeFace."]
11402 #[doc = " - A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both,"]
11403 #[doc = " cudaArrayCubemap and cudaArrayLayered flags are set. Width must be equal to height, and depth must be"]
11404 #[doc = " a multiple of six. A cubemap layered CUDA mipmapped array is a special type of 2D layered CUDA mipmapped"]
11405 #[doc = " array that consists of a collection of cubemap mipmapped arrays. The first six layers represent the"]
11406 #[doc = " first cubemap mipmapped array, the next six layers form the second cubemap mipmapped array, and so on."]
11407 #[doc = ""]
11408 #[doc = ""]
11409 #[doc = " The \\p flags parameter enables different options to be specified that affect"]
11410 #[doc = " the allocation, as follows."]
11411 #[doc = " - ::cudaArrayDefault: This flag's value is defined to be 0 and provides default mipmapped array allocation"]
11412 #[doc = " - ::cudaArrayLayered: Allocates a layered CUDA mipmapped array, with the depth extent indicating the number of layers"]
11413 #[doc = " - ::cudaArrayCubemap: Allocates a cubemap CUDA mipmapped array. Width must be equal to height, and depth must be six."]
11414 #[doc = " If the cudaArrayLayered flag is also set, depth must be a multiple of six."]
11415 #[doc = " - ::cudaArraySurfaceLoadStore: This flag indicates that individual mipmap levels of the CUDA mipmapped array"]
11416 #[doc = " will be read from or written to using a surface reference."]
11417 #[doc = " - ::cudaArrayTextureGather: This flag indicates that texture gather operations will be performed on the CUDA"]
11418 #[doc = " array. Texture gather can only be performed on 2D CUDA mipmapped arrays, and the gather operations are"]
11419 #[doc = " performed only on the most detailed mipmap level."]
11420 #[doc = " - ::cudaArraySparse: Allocates a CUDA array without physical backing memory. The subregions within this sparse array"]
11421 #[doc = " can later be mapped to physical memory by calling ::cuMemMapArrayAsync. This flag can only be used for creating"]
11422 #[doc = " 2D, 3D or 2D layered sparse CUDA mipmapped arrays. The physical backing memory must be allocated via ::cuMemCreate."]
11423 #[doc = ""]
11424 #[doc = " The width, height and depth extents must meet certain size requirements as listed in the following table."]
11425 #[doc = " All values are specified in elements."]
11426 #[doc = ""]
11427 #[doc = " \\xmlonly"]
11428 #[doc = " <table outputclass=\"xmlonly\">"]
11429 #[doc = " <tgroup cols=\"3\" colsep=\"1\" rowsep=\"1\">"]
11430 #[doc = " <colspec colname=\"c1\" colwidth=\"1.0*\"/>"]
11431 #[doc = " <colspec colname=\"c2\" colwidth=\"3.0*\"/>"]
11432 #[doc = " <colspec colname=\"c3\" colwidth=\"3.0*\"/>"]
11433 #[doc = " <thead>"]
11434 #[doc = " <row>"]
11435 #[doc = " <entry>CUDA array type</entry>"]
11436 #[doc = " <entry>Valid extents that must always be met {(width range in elements),"]
11437 #[doc = " (height range), (depth range)}</entry>"]
11438 #[doc = " <entry>Valid extents with cudaArraySurfaceLoadStore set {(width range in"]
11439 #[doc = " elements), (height range), (depth range)}</entry>"]
11440 #[doc = " </row>"]
11441 #[doc = " </thead>"]
11442 #[doc = " <tbody>"]
11443 #[doc = " <row>"]
11444 #[doc = " <entry>1D</entry>"]
11445 #[doc = " <entry>{ (1,maxTexture1DMipmap), 0, 0 }</entry>"]
11446 #[doc = " <entry>{ (1,maxSurface1D), 0, 0 }</entry>"]
11447 #[doc = " </row>"]
11448 #[doc = " <row>"]
11449 #[doc = " <entry>2D</entry>"]
11450 #[doc = " <entry>{ (1,maxTexture2DMipmap[0]), (1,maxTexture2DMipmap[1]), 0 }</entry>"]
11451 #[doc = " <entry>{ (1,maxSurface2D[0]), (1,maxSurface2D[1]), 0 }</entry>"]
11452 #[doc = " </row>"]
11453 #[doc = " <row>"]
11454 #[doc = " <entry>3D</entry>"]
11455 #[doc = " <entry>{ (1,maxTexture3D[0]), (1,maxTexture3D[1]), (1,maxTexture3D[2]) }"]
11456 #[doc = " OR { (1,maxTexture3DAlt[0]), (1,maxTexture3DAlt[1]),"]
11457 #[doc = " (1,maxTexture3DAlt[2]) }</entry>"]
11458 #[doc = " <entry>{ (1,maxSurface3D[0]), (1,maxSurface3D[1]), (1,maxSurface3D[2]) }</entry>"]
11459 #[doc = " </row>"]
11460 #[doc = " <row>"]
11461 #[doc = " <entry>1D Layered</entry>"]
11462 #[doc = " <entry>{ (1,maxTexture1DLayered[0]), 0, (1,maxTexture1DLayered[1]) }</entry>"]
11463 #[doc = " <entry>{ (1,maxSurface1DLayered[0]), 0, (1,maxSurface1DLayered[1]) }</entry>"]
11464 #[doc = " </row>"]
11465 #[doc = " <row>"]
11466 #[doc = " <entry>2D Layered</entry>"]
11467 #[doc = " <entry>{ (1,maxTexture2DLayered[0]), (1,maxTexture2DLayered[1]),"]
11468 #[doc = " (1,maxTexture2DLayered[2]) }</entry>"]
11469 #[doc = " <entry>{ (1,maxSurface2DLayered[0]), (1,maxSurface2DLayered[1]),"]
11470 #[doc = " (1,maxSurface2DLayered[2]) }</entry>"]
11471 #[doc = " </row>"]
11472 #[doc = " <row>"]
11473 #[doc = " <entry>Cubemap</entry>"]
11474 #[doc = " <entry>{ (1,maxTextureCubemap), (1,maxTextureCubemap), 6 }</entry>"]
11475 #[doc = " <entry>{ (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 }</entry>"]
11476 #[doc = " </row>"]
11477 #[doc = " <row>"]
11478 #[doc = " <entry>Cubemap Layered</entry>"]
11479 #[doc = " <entry>{ (1,maxTextureCubemapLayered[0]), (1,maxTextureCubemapLayered[0]),"]
11480 #[doc = " (1,maxTextureCubemapLayered[1]) }</entry>"]
11481 #[doc = " <entry>{ (1,maxSurfaceCubemapLayered[0]), (1,maxSurfaceCubemapLayered[0]),"]
11482 #[doc = " (1,maxSurfaceCubemapLayered[1]) }</entry>"]
11483 #[doc = " </row>"]
11484 #[doc = " </tbody>"]
11485 #[doc = " </tgroup>"]
11486 #[doc = " </table>"]
11487 #[doc = " \\endxmlonly"]
11488 #[doc = ""]
11489 #[doc = " \\param mipmappedArray - Pointer to allocated mipmapped array in device memory"]
11490 #[doc = " \\param desc - Requested channel format"]
11491 #[doc = " \\param extent - Requested allocation size (\\p width field in elements)"]
11492 #[doc = " \\param numLevels - Number of mipmap levels to allocate"]
11493 #[doc = " \\param flags - Flags for extensions"]
11494 #[doc = ""]
11495 #[doc = " \\return"]
11496 #[doc = " ::cudaSuccess,"]
11497 #[doc = " ::cudaErrorInvalidValue,"]
11498 #[doc = " ::cudaErrorMemoryAllocation"]
11499 #[doc = " \\notefnerr"]
11500 #[doc = " \\note_init_rt"]
11501 #[doc = " \\note_callback"]
11502 #[doc = ""]
11503 #[doc = " \\sa ::cudaMalloc3D, ::cudaMalloc, ::cudaMallocPitch, ::cudaFree,"]
11504 #[doc = " ::cudaFreeArray,"]
11505 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
11506 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
11507 #[doc = " ::make_cudaExtent,"]
11508 #[doc = " ::cuMipmappedArrayCreate"]
11509 pub fn cudaMallocMipmappedArray(
11510 mipmappedArray: *mut cudaMipmappedArray_t,
11511 desc: *const cudaChannelFormatDesc,
11512 extent: cudaExtent,
11513 numLevels: ::libc::c_uint,
11514 flags: ::libc::c_uint,
11515 ) -> cudaError_t;
11516}
11517extern "C" {
11518 #[doc = " \\brief Gets a mipmap level of a CUDA mipmapped array"]
11519 #[doc = ""]
11520 #[doc = " Returns in \\p *levelArray a CUDA array that represents a single mipmap level"]
11521 #[doc = " of the CUDA mipmapped array \\p mipmappedArray."]
11522 #[doc = ""]
11523 #[doc = " If \\p level is greater than the maximum number of levels in this mipmapped array,"]
11524 #[doc = " ::cudaErrorInvalidValue is returned."]
11525 #[doc = ""]
11526 #[doc = " If \\p mipmappedArray is NULL,"]
11527 #[doc = " ::cudaErrorInvalidResourceHandle is returned."]
11528 #[doc = ""]
11529 #[doc = " \\param levelArray - Returned mipmap level CUDA array"]
11530 #[doc = " \\param mipmappedArray - CUDA mipmapped array"]
11531 #[doc = " \\param level - Mipmap level"]
11532 #[doc = ""]
11533 #[doc = " \\return"]
11534 #[doc = " ::cudaSuccess,"]
11535 #[doc = " ::cudaErrorInvalidValue"]
11536 #[doc = " ::cudaErrorInvalidResourceHandle"]
11537 #[doc = " \\notefnerr"]
11538 #[doc = " \\note_init_rt"]
11539 #[doc = " \\note_callback"]
11540 #[doc = ""]
11541 #[doc = " \\sa ::cudaMalloc3D, ::cudaMalloc, ::cudaMallocPitch, ::cudaFree,"]
11542 #[doc = " ::cudaFreeArray,"]
11543 #[doc = " \\ref ::cudaMallocHost(void**, size_t) \"cudaMallocHost (C API)\","]
11544 #[doc = " ::cudaFreeHost, ::cudaHostAlloc,"]
11545 #[doc = " ::make_cudaExtent,"]
11546 #[doc = " ::cuMipmappedArrayGetLevel"]
11547 pub fn cudaGetMipmappedArrayLevel(
11548 levelArray: *mut cudaArray_t,
11549 mipmappedArray: cudaMipmappedArray_const_t,
11550 level: ::libc::c_uint,
11551 ) -> cudaError_t;
11552}
11553extern "C" {
11554 #[doc = " \\brief Copies data between 3D objects"]
11555 #[doc = ""]
11556 #[doc = "\\code"]
11557 #[doc = "struct cudaExtent {"]
11558 #[doc = "size_t width;"]
11559 #[doc = "size_t height;"]
11560 #[doc = "size_t depth;"]
11561 #[doc = "};"]
11562 #[doc = "struct cudaExtent make_cudaExtent(size_t w, size_t h, size_t d);"]
11563 #[doc = ""]
11564 #[doc = "struct cudaPos {"]
11565 #[doc = "size_t x;"]
11566 #[doc = "size_t y;"]
11567 #[doc = "size_t z;"]
11568 #[doc = "};"]
11569 #[doc = "struct cudaPos make_cudaPos(size_t x, size_t y, size_t z);"]
11570 #[doc = ""]
11571 #[doc = "struct cudaMemcpy3DParms {"]
11572 #[doc = "cudaArray_t srcArray;"]
11573 #[doc = "struct cudaPos srcPos;"]
11574 #[doc = "struct cudaPitchedPtr srcPtr;"]
11575 #[doc = "cudaArray_t dstArray;"]
11576 #[doc = "struct cudaPos dstPos;"]
11577 #[doc = "struct cudaPitchedPtr dstPtr;"]
11578 #[doc = "struct cudaExtent extent;"]
11579 #[doc = "enum cudaMemcpyKind kind;"]
11580 #[doc = "};"]
11581 #[doc = "\\endcode"]
11582 #[doc = ""]
11583 #[doc = " ::cudaMemcpy3D() copies data betwen two 3D objects. The source and"]
11584 #[doc = " destination objects may be in either host memory, device memory, or a CUDA"]
11585 #[doc = " array. The source, destination, extent, and kind of copy performed is"]
11586 #[doc = " specified by the ::cudaMemcpy3DParms struct which should be initialized to"]
11587 #[doc = " zero before use:"]
11588 #[doc = "\\code"]
11589 #[doc = "cudaMemcpy3DParms myParms = {0};"]
11590 #[doc = "\\endcode"]
11591 #[doc = ""]
11592 #[doc = " The struct passed to ::cudaMemcpy3D() must specify one of \\p srcArray or"]
11593 #[doc = " \\p srcPtr and one of \\p dstArray or \\p dstPtr. Passing more than one"]
11594 #[doc = " non-zero source or destination will cause ::cudaMemcpy3D() to return an"]
11595 #[doc = " error."]
11596 #[doc = ""]
11597 #[doc = " The \\p srcPos and \\p dstPos fields are optional offsets into the source and"]
11598 #[doc = " destination objects and are defined in units of each object's elements. The"]
11599 #[doc = " element for a host or device pointer is assumed to be <b>unsigned char</b>."]
11600 #[doc = ""]
11601 #[doc = " The \\p extent field defines the dimensions of the transferred area in"]
11602 #[doc = " elements. If a CUDA array is participating in the copy, the extent is"]
11603 #[doc = " defined in terms of that array's elements. If no CUDA array is"]
11604 #[doc = " participating in the copy then the extents are defined in elements of"]
11605 #[doc = " <b>unsigned char</b>."]
11606 #[doc = ""]
11607 #[doc = " The \\p kind field defines the direction of the copy. It must be one of"]
11608 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
11609 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
11610 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
11611 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
11612 #[doc = " allowed on systems that support unified virtual addressing."]
11613 #[doc = " For ::cudaMemcpyHostToHost or ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost"]
11614 #[doc = " passed as kind and cudaArray type passed as source or destination, if the kind"]
11615 #[doc = " implies cudaArray type to be present on the host, ::cudaMemcpy3D() will"]
11616 #[doc = " disregard that implication and silently correct the kind based on the fact that"]
11617 #[doc = " cudaArray type can only be present on the device."]
11618 #[doc = ""]
11619 #[doc = " If the source and destination are both arrays, ::cudaMemcpy3D() will return"]
11620 #[doc = " an error if they do not have the same element size."]
11621 #[doc = ""]
11622 #[doc = " The source and destination object may not overlap. If overlapping source"]
11623 #[doc = " and destination objects are specified, undefined behavior will result."]
11624 #[doc = ""]
11625 #[doc = " The source object must entirely contain the region defined by \\p srcPos"]
11626 #[doc = " and \\p extent. The destination object must entirely contain the region"]
11627 #[doc = " defined by \\p dstPos and \\p extent."]
11628 #[doc = ""]
11629 #[doc = " ::cudaMemcpy3D() returns an error if the pitch of \\p srcPtr or \\p dstPtr"]
11630 #[doc = " exceeds the maximum allowed. The pitch of a ::cudaPitchedPtr allocated"]
11631 #[doc = " with ::cudaMalloc3D() will always be valid."]
11632 #[doc = ""]
11633 #[doc = " \\param p - 3D memory copy parameters"]
11634 #[doc = ""]
11635 #[doc = " \\return"]
11636 #[doc = " ::cudaSuccess,"]
11637 #[doc = " ::cudaErrorInvalidValue,"]
11638 #[doc = " ::cudaErrorInvalidPitchValue,"]
11639 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
11640 #[doc = " \\notefnerr"]
11641 #[doc = " \\note_sync"]
11642 #[doc = " \\note_init_rt"]
11643 #[doc = " \\note_callback"]
11644 #[doc = ""]
11645 #[doc = " \\sa ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaMemset3D, ::cudaMemcpy3DAsync,"]
11646 #[doc = " ::cudaMemcpy, ::cudaMemcpy2D,"]
11647 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
11648 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
11649 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
11650 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
11651 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
11652 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
11653 #[doc = " ::make_cudaExtent, ::make_cudaPos,"]
11654 #[doc = " ::cuMemcpy3D"]
11655 pub fn cudaMemcpy3D(p: *const cudaMemcpy3DParms) -> cudaError_t;
11656}
11657extern "C" {
11658 #[doc = " \\brief Copies memory between devices"]
11659 #[doc = ""]
11660 #[doc = " Perform a 3D memory copy according to the parameters specified in"]
11661 #[doc = " \\p p. See the definition of the ::cudaMemcpy3DPeerParms structure"]
11662 #[doc = " for documentation of its parameters."]
11663 #[doc = ""]
11664 #[doc = " Note that this function is synchronous with respect to the host only if"]
11665 #[doc = " the source or destination of the transfer is host memory. Note also"]
11666 #[doc = " that this copy is serialized with respect to all pending and future"]
11667 #[doc = " asynchronous work in to the current device, the copy's source device,"]
11668 #[doc = " and the copy's destination device (use ::cudaMemcpy3DPeerAsync to avoid"]
11669 #[doc = " this synchronization)."]
11670 #[doc = ""]
11671 #[doc = " \\param p - Parameters for the memory copy"]
11672 #[doc = ""]
11673 #[doc = " \\return"]
11674 #[doc = " ::cudaSuccess,"]
11675 #[doc = " ::cudaErrorInvalidValue,"]
11676 #[doc = " ::cudaErrorInvalidDevice"]
11677 #[doc = " \\notefnerr"]
11678 #[doc = " \\note_sync"]
11679 #[doc = " \\note_init_rt"]
11680 #[doc = " \\note_callback"]
11681 #[doc = ""]
11682 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyPeer, ::cudaMemcpyAsync, ::cudaMemcpyPeerAsync,"]
11683 #[doc = " ::cudaMemcpy3DPeerAsync,"]
11684 #[doc = " ::cuMemcpy3DPeer"]
11685 pub fn cudaMemcpy3DPeer(p: *const cudaMemcpy3DPeerParms) -> cudaError_t;
11686}
11687extern "C" {
11688 #[doc = " \\brief Copies data between 3D objects"]
11689 #[doc = ""]
11690 #[doc = "\\code"]
11691 #[doc = "struct cudaExtent {"]
11692 #[doc = "size_t width;"]
11693 #[doc = "size_t height;"]
11694 #[doc = "size_t depth;"]
11695 #[doc = "};"]
11696 #[doc = "struct cudaExtent make_cudaExtent(size_t w, size_t h, size_t d);"]
11697 #[doc = ""]
11698 #[doc = "struct cudaPos {"]
11699 #[doc = "size_t x;"]
11700 #[doc = "size_t y;"]
11701 #[doc = "size_t z;"]
11702 #[doc = "};"]
11703 #[doc = "struct cudaPos make_cudaPos(size_t x, size_t y, size_t z);"]
11704 #[doc = ""]
11705 #[doc = "struct cudaMemcpy3DParms {"]
11706 #[doc = "cudaArray_t srcArray;"]
11707 #[doc = "struct cudaPos srcPos;"]
11708 #[doc = "struct cudaPitchedPtr srcPtr;"]
11709 #[doc = "cudaArray_t dstArray;"]
11710 #[doc = "struct cudaPos dstPos;"]
11711 #[doc = "struct cudaPitchedPtr dstPtr;"]
11712 #[doc = "struct cudaExtent extent;"]
11713 #[doc = "enum cudaMemcpyKind kind;"]
11714 #[doc = "};"]
11715 #[doc = "\\endcode"]
11716 #[doc = ""]
11717 #[doc = " ::cudaMemcpy3DAsync() copies data betwen two 3D objects. The source and"]
11718 #[doc = " destination objects may be in either host memory, device memory, or a CUDA"]
11719 #[doc = " array. The source, destination, extent, and kind of copy performed is"]
11720 #[doc = " specified by the ::cudaMemcpy3DParms struct which should be initialized to"]
11721 #[doc = " zero before use:"]
11722 #[doc = "\\code"]
11723 #[doc = "cudaMemcpy3DParms myParms = {0};"]
11724 #[doc = "\\endcode"]
11725 #[doc = ""]
11726 #[doc = " The struct passed to ::cudaMemcpy3DAsync() must specify one of \\p srcArray"]
11727 #[doc = " or \\p srcPtr and one of \\p dstArray or \\p dstPtr. Passing more than one"]
11728 #[doc = " non-zero source or destination will cause ::cudaMemcpy3DAsync() to return an"]
11729 #[doc = " error."]
11730 #[doc = ""]
11731 #[doc = " The \\p srcPos and \\p dstPos fields are optional offsets into the source and"]
11732 #[doc = " destination objects and are defined in units of each object's elements. The"]
11733 #[doc = " element for a host or device pointer is assumed to be <b>unsigned char</b>."]
11734 #[doc = " For CUDA arrays, positions must be in the range [0, 2048) for any"]
11735 #[doc = " dimension."]
11736 #[doc = ""]
11737 #[doc = " The \\p extent field defines the dimensions of the transferred area in"]
11738 #[doc = " elements. If a CUDA array is participating in the copy, the extent is"]
11739 #[doc = " defined in terms of that array's elements. If no CUDA array is"]
11740 #[doc = " participating in the copy then the extents are defined in elements of"]
11741 #[doc = " <b>unsigned char</b>."]
11742 #[doc = ""]
11743 #[doc = " The \\p kind field defines the direction of the copy. It must be one of"]
11744 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
11745 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
11746 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
11747 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
11748 #[doc = " allowed on systems that support unified virtual addressing."]
11749 #[doc = " For ::cudaMemcpyHostToHost or ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost"]
11750 #[doc = " passed as kind and cudaArray type passed as source or destination, if the kind"]
11751 #[doc = " implies cudaArray type to be present on the host, ::cudaMemcpy3DAsync() will"]
11752 #[doc = " disregard that implication and silently correct the kind based on the fact that"]
11753 #[doc = " cudaArray type can only be present on the device."]
11754 #[doc = ""]
11755 #[doc = " If the source and destination are both arrays, ::cudaMemcpy3DAsync() will"]
11756 #[doc = " return an error if they do not have the same element size."]
11757 #[doc = ""]
11758 #[doc = " The source and destination object may not overlap. If overlapping source"]
11759 #[doc = " and destination objects are specified, undefined behavior will result."]
11760 #[doc = ""]
11761 #[doc = " The source object must lie entirely within the region defined by \\p srcPos"]
11762 #[doc = " and \\p extent. The destination object must lie entirely within the region"]
11763 #[doc = " defined by \\p dstPos and \\p extent."]
11764 #[doc = ""]
11765 #[doc = " ::cudaMemcpy3DAsync() returns an error if the pitch of \\p srcPtr or"]
11766 #[doc = " \\p dstPtr exceeds the maximum allowed. The pitch of a"]
11767 #[doc = " ::cudaPitchedPtr allocated with ::cudaMalloc3D() will always be valid."]
11768 #[doc = ""]
11769 #[doc = " ::cudaMemcpy3DAsync() is asynchronous with respect to the host, so"]
11770 #[doc = " the call may return before the copy is complete. The copy can optionally"]
11771 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If"]
11772 #[doc = " \\p kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and \\p stream"]
11773 #[doc = " is non-zero, the copy may overlap with operations in other streams."]
11774 #[doc = ""]
11775 #[doc = " The device version of this function only handles device to device copies and"]
11776 #[doc = " cannot be given local or shared pointers."]
11777 #[doc = ""]
11778 #[doc = " \\param p - 3D memory copy parameters"]
11779 #[doc = " \\param stream - Stream identifier"]
11780 #[doc = ""]
11781 #[doc = " \\return"]
11782 #[doc = " ::cudaSuccess,"]
11783 #[doc = " ::cudaErrorInvalidValue,"]
11784 #[doc = " ::cudaErrorInvalidPitchValue,"]
11785 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
11786 #[doc = " \\notefnerr"]
11787 #[doc = " \\note_async"]
11788 #[doc = " \\note_null_stream"]
11789 #[doc = " \\note_init_rt"]
11790 #[doc = " \\note_callback"]
11791 #[doc = ""]
11792 #[doc = " \\sa ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaMemset3D, ::cudaMemcpy3D,"]
11793 #[doc = " ::cudaMemcpy, ::cudaMemcpy2D,"]
11794 #[doc = " ::cudaMemcpy2DToArray, :::cudaMemcpy2DFromArray,"]
11795 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
11796 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
11797 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
11798 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
11799 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
11800 #[doc = " ::make_cudaExtent, ::make_cudaPos,"]
11801 #[doc = " ::cuMemcpy3DAsync"]
11802 pub fn cudaMemcpy3DAsync(p: *const cudaMemcpy3DParms, stream: cudaStream_t) -> cudaError_t;
11803}
11804extern "C" {
11805 #[doc = " \\brief Copies memory between devices asynchronously."]
11806 #[doc = ""]
11807 #[doc = " Perform a 3D memory copy according to the parameters specified in"]
11808 #[doc = " \\p p. See the definition of the ::cudaMemcpy3DPeerParms structure"]
11809 #[doc = " for documentation of its parameters."]
11810 #[doc = ""]
11811 #[doc = " \\param p - Parameters for the memory copy"]
11812 #[doc = " \\param stream - Stream identifier"]
11813 #[doc = ""]
11814 #[doc = " \\return"]
11815 #[doc = " ::cudaSuccess,"]
11816 #[doc = " ::cudaErrorInvalidValue,"]
11817 #[doc = " ::cudaErrorInvalidDevice"]
11818 #[doc = " \\notefnerr"]
11819 #[doc = " \\note_async"]
11820 #[doc = " \\note_null_stream"]
11821 #[doc = " \\note_init_rt"]
11822 #[doc = " \\note_callback"]
11823 #[doc = ""]
11824 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyPeer, ::cudaMemcpyAsync, ::cudaMemcpyPeerAsync,"]
11825 #[doc = " ::cudaMemcpy3DPeerAsync,"]
11826 #[doc = " ::cuMemcpy3DPeerAsync"]
11827 pub fn cudaMemcpy3DPeerAsync(
11828 p: *const cudaMemcpy3DPeerParms,
11829 stream: cudaStream_t,
11830 ) -> cudaError_t;
11831}
11832extern "C" {
11833 #[doc = " \\brief Gets free and total device memory"]
11834 #[doc = ""]
11835 #[doc = " Returns in \\p *free and \\p *total respectively, the free and total amount of"]
11836 #[doc = " memory available for allocation by the device in bytes."]
11837 #[doc = ""]
11838 #[doc = " \\param free - Returned free memory in bytes"]
11839 #[doc = " \\param total - Returned total memory in bytes"]
11840 #[doc = ""]
11841 #[doc = " \\return"]
11842 #[doc = " ::cudaSuccess,"]
11843 #[doc = " ::cudaErrorInvalidValue,"]
11844 #[doc = " ::cudaErrorLaunchFailure"]
11845 #[doc = " \\notefnerr"]
11846 #[doc = " \\note_init_rt"]
11847 #[doc = " \\note_callback"]
11848 #[doc = ""]
11849 #[doc = " \\sa"]
11850 #[doc = " ::cuMemGetInfo"]
11851 pub fn cudaMemGetInfo(free: *mut usize, total: *mut usize) -> cudaError_t;
11852}
11853extern "C" {
11854 #[doc = " \\brief Gets info about the specified cudaArray"]
11855 #[doc = ""]
11856 #[doc = " Returns in \\p *desc, \\p *extent and \\p *flags respectively, the type, shape"]
11857 #[doc = " and flags of \\p array."]
11858 #[doc = ""]
11859 #[doc = " Any of \\p *desc, \\p *extent and \\p *flags may be specified as NULL."]
11860 #[doc = ""]
11861 #[doc = " \\param desc - Returned array type"]
11862 #[doc = " \\param extent - Returned array shape. 2D arrays will have depth of zero"]
11863 #[doc = " \\param flags - Returned array flags"]
11864 #[doc = " \\param array - The ::cudaArray to get info for"]
11865 #[doc = ""]
11866 #[doc = " \\return"]
11867 #[doc = " ::cudaSuccess,"]
11868 #[doc = " ::cudaErrorInvalidValue"]
11869 #[doc = " \\notefnerr"]
11870 #[doc = " \\note_init_rt"]
11871 #[doc = " \\note_callback"]
11872 #[doc = ""]
11873 #[doc = " \\sa"]
11874 #[doc = " ::cuArrayGetDescriptor,"]
11875 #[doc = " ::cuArray3DGetDescriptor"]
11876 pub fn cudaArrayGetInfo(
11877 desc: *mut cudaChannelFormatDesc,
11878 extent: *mut cudaExtent,
11879 flags: *mut ::libc::c_uint,
11880 array: cudaArray_t,
11881 ) -> cudaError_t;
11882}
11883extern "C" {
11884 #[doc = " \\brief Gets a CUDA array plane from a CUDA array"]
11885 #[doc = ""]
11886 #[doc = " Returns in \\p pPlaneArray a CUDA array that represents a single format plane"]
11887 #[doc = " of the CUDA array \\p hArray."]
11888 #[doc = ""]
11889 #[doc = " If \\p planeIdx is greater than the maximum number of planes in this array or if the array does"]
11890 #[doc = " not have a multi-planar format e.g: ::cudaChannelFormatKindNV12, then ::cudaErrorInvalidValue is returned."]
11891 #[doc = ""]
11892 #[doc = " Note that if the \\p hArray has format ::cudaChannelFormatKindNV12, then passing in 0 for \\p planeIdx returns"]
11893 #[doc = " a CUDA array of the same size as \\p hArray but with one 8-bit channel and ::cudaChannelFormatKindUnsigned as its format kind."]
11894 #[doc = " If 1 is passed for \\p planeIdx, then the returned CUDA array has half the height and width"]
11895 #[doc = " of \\p hArray with two 8-bit channels and ::cudaChannelFormatKindUnsigned as its format kind."]
11896 #[doc = ""]
11897 #[doc = " \\param pPlaneArray - Returned CUDA array referenced by the \\p planeIdx"]
11898 #[doc = " \\param hArray - CUDA array"]
11899 #[doc = " \\param planeIdx - Plane index"]
11900 #[doc = ""]
11901 #[doc = " \\return"]
11902 #[doc = " ::cudaSuccess,"]
11903 #[doc = " ::cudaErrorInvalidValue"]
11904 #[doc = " ::cudaErrorInvalidResourceHandle"]
11905 #[doc = " \\notefnerr"]
11906 #[doc = ""]
11907 #[doc = " \\sa"]
11908 #[doc = " ::cuArrayGetPlane"]
11909 pub fn cudaArrayGetPlane(
11910 pPlaneArray: *mut cudaArray_t,
11911 hArray: cudaArray_t,
11912 planeIdx: ::libc::c_uint,
11913 ) -> cudaError_t;
11914}
11915extern "C" {
11916 pub fn cudaArrayGetSparseProperties(
11917 sparseProperties: *mut cudaArraySparseProperties,
11918 array: cudaArray_t,
11919 ) -> cudaError_t;
11920}
11921extern "C" {
11922 pub fn cudaMipmappedArrayGetSparseProperties(
11923 sparseProperties: *mut cudaArraySparseProperties,
11924 mipmap: cudaMipmappedArray_t,
11925 ) -> cudaError_t;
11926}
11927extern "C" {
11928 #[doc = " \\brief Copies data between host and device"]
11929 #[doc = ""]
11930 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src to the"]
11931 #[doc = " memory area pointed to by \\p dst, where \\p kind specifies the direction"]
11932 #[doc = " of the copy, and must be one of ::cudaMemcpyHostToHost,"]
11933 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
11934 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
11935 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
11936 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
11937 #[doc = " allowed on systems that support unified virtual addressing. Calling"]
11938 #[doc = " ::cudaMemcpy() with dst and src pointers that do not match the direction of"]
11939 #[doc = " the copy results in an undefined behavior."]
11940 #[doc = ""]
11941 #[doc = " \\param dst - Destination memory address"]
11942 #[doc = " \\param src - Source memory address"]
11943 #[doc = " \\param count - Size in bytes to copy"]
11944 #[doc = " \\param kind - Type of transfer"]
11945 #[doc = ""]
11946 #[doc = " \\return"]
11947 #[doc = " ::cudaSuccess,"]
11948 #[doc = " ::cudaErrorInvalidValue,"]
11949 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
11950 #[doc = " \\notefnerr"]
11951 #[doc = " \\note_init_rt"]
11952 #[doc = " \\note_callback"]
11953 #[doc = ""]
11954 #[doc = " \\note_sync"]
11955 #[doc = " \\note_memcpy"]
11956 #[doc = ""]
11957 #[doc = " \\sa ::cudaMemcpy2D,"]
11958 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
11959 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
11960 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
11961 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
11962 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
11963 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
11964 #[doc = " ::cuMemcpyDtoH,"]
11965 #[doc = " ::cuMemcpyHtoD,"]
11966 #[doc = " ::cuMemcpyDtoD,"]
11967 #[doc = " ::cuMemcpy"]
11968 pub fn cudaMemcpy(
11969 dst: *mut ::libc::c_void,
11970 src: *const ::libc::c_void,
11971 count: usize,
11972 kind: cudaMemcpyKind,
11973 ) -> cudaError_t;
11974}
11975extern "C" {
11976 #[doc = " \\brief Copies memory between two devices"]
11977 #[doc = ""]
11978 #[doc = " Copies memory from one device to memory on another device. \\p dst is the"]
11979 #[doc = " base device pointer of the destination memory and \\p dstDevice is the"]
11980 #[doc = " destination device. \\p src is the base device pointer of the source memory"]
11981 #[doc = " and \\p srcDevice is the source device. \\p count specifies the number of bytes"]
11982 #[doc = " to copy."]
11983 #[doc = ""]
11984 #[doc = " Note that this function is asynchronous with respect to the host, but"]
11985 #[doc = " serialized with respect all pending and future asynchronous work in to the"]
11986 #[doc = " current device, \\p srcDevice, and \\p dstDevice (use ::cudaMemcpyPeerAsync"]
11987 #[doc = " to avoid this synchronization)."]
11988 #[doc = ""]
11989 #[doc = " \\param dst - Destination device pointer"]
11990 #[doc = " \\param dstDevice - Destination device"]
11991 #[doc = " \\param src - Source device pointer"]
11992 #[doc = " \\param srcDevice - Source device"]
11993 #[doc = " \\param count - Size of memory copy in bytes"]
11994 #[doc = ""]
11995 #[doc = " \\return"]
11996 #[doc = " ::cudaSuccess,"]
11997 #[doc = " ::cudaErrorInvalidValue,"]
11998 #[doc = " ::cudaErrorInvalidDevice"]
11999 #[doc = " \\notefnerr"]
12000 #[doc = " \\note_sync"]
12001 #[doc = " \\note_init_rt"]
12002 #[doc = " \\note_callback"]
12003 #[doc = ""]
12004 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyAsync, ::cudaMemcpyPeerAsync,"]
12005 #[doc = " ::cudaMemcpy3DPeerAsync,"]
12006 #[doc = " ::cuMemcpyPeer"]
12007 pub fn cudaMemcpyPeer(
12008 dst: *mut ::libc::c_void,
12009 dstDevice: ::libc::c_int,
12010 src: *const ::libc::c_void,
12011 srcDevice: ::libc::c_int,
12012 count: usize,
12013 ) -> cudaError_t;
12014}
12015extern "C" {
12016 #[doc = " \\brief Copies data between host and device"]
12017 #[doc = ""]
12018 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the memory"]
12019 #[doc = " area pointed to by \\p src to the memory area pointed to by \\p dst, where"]
12020 #[doc = " \\p kind specifies the direction of the copy, and must be one of"]
12021 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12022 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12023 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12024 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12025 #[doc = " allowed on systems that support unified virtual addressing. \\p dpitch and"]
12026 #[doc = " \\p spitch are the widths in memory in bytes of the 2D arrays pointed to by"]
12027 #[doc = " \\p dst and \\p src, including any padding added to the end of each row. The"]
12028 #[doc = " memory areas may not overlap. \\p width must not exceed either \\p dpitch or"]
12029 #[doc = " \\p spitch. Calling ::cudaMemcpy2D() with \\p dst and \\p src pointers that do"]
12030 #[doc = " not match the direction of the copy results in an undefined behavior."]
12031 #[doc = " ::cudaMemcpy2D() returns an error if \\p dpitch or \\p spitch exceeds"]
12032 #[doc = " the maximum allowed."]
12033 #[doc = ""]
12034 #[doc = " \\param dst - Destination memory address"]
12035 #[doc = " \\param dpitch - Pitch of destination memory"]
12036 #[doc = " \\param src - Source memory address"]
12037 #[doc = " \\param spitch - Pitch of source memory"]
12038 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12039 #[doc = " \\param height - Height of matrix transfer (rows)"]
12040 #[doc = " \\param kind - Type of transfer"]
12041 #[doc = ""]
12042 #[doc = " \\return"]
12043 #[doc = " ::cudaSuccess,"]
12044 #[doc = " ::cudaErrorInvalidValue,"]
12045 #[doc = " ::cudaErrorInvalidPitchValue,"]
12046 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12047 #[doc = " \\notefnerr"]
12048 #[doc = " \\note_init_rt"]
12049 #[doc = " \\note_callback"]
12050 #[doc = " \\note_memcpy"]
12051 #[doc = ""]
12052 #[doc = " \\sa ::cudaMemcpy,"]
12053 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12054 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12055 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12056 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12057 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12058 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12059 #[doc = " ::cuMemcpy2D,"]
12060 #[doc = " ::cuMemcpy2DUnaligned"]
12061 pub fn cudaMemcpy2D(
12062 dst: *mut ::libc::c_void,
12063 dpitch: usize,
12064 src: *const ::libc::c_void,
12065 spitch: usize,
12066 width: usize,
12067 height: usize,
12068 kind: cudaMemcpyKind,
12069 ) -> cudaError_t;
12070}
12071extern "C" {
12072 #[doc = " \\brief Copies data between host and device"]
12073 #[doc = ""]
12074 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the memory"]
12075 #[doc = " area pointed to by \\p src to the CUDA array \\p dst starting at"]
12076 #[doc = " \\p hOffset rows and \\p wOffset bytes from the upper left corner,"]
12077 #[doc = " where \\p kind specifies the direction of the copy, and must be one"]
12078 #[doc = " of ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12079 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12080 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12081 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12082 #[doc = " allowed on systems that support unified virtual addressing."]
12083 #[doc = " \\p spitch is the width in memory in bytes of the 2D array pointed to by"]
12084 #[doc = " \\p src, including any padding added to the end of each row. \\p wOffset +"]
12085 #[doc = " \\p width must not exceed the width of the CUDA array \\p dst. \\p width must"]
12086 #[doc = " not exceed \\p spitch. ::cudaMemcpy2DToArray() returns an error if \\p spitch"]
12087 #[doc = " exceeds the maximum allowed."]
12088 #[doc = ""]
12089 #[doc = " \\param dst - Destination memory address"]
12090 #[doc = " \\param wOffset - Destination starting X offset (columns in bytes)"]
12091 #[doc = " \\param hOffset - Destination starting Y offset (rows)"]
12092 #[doc = " \\param src - Source memory address"]
12093 #[doc = " \\param spitch - Pitch of source memory"]
12094 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12095 #[doc = " \\param height - Height of matrix transfer (rows)"]
12096 #[doc = " \\param kind - Type of transfer"]
12097 #[doc = ""]
12098 #[doc = " \\return"]
12099 #[doc = " ::cudaSuccess,"]
12100 #[doc = " ::cudaErrorInvalidValue,"]
12101 #[doc = " ::cudaErrorInvalidPitchValue,"]
12102 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12103 #[doc = " \\notefnerr"]
12104 #[doc = " \\note_sync"]
12105 #[doc = " \\note_init_rt"]
12106 #[doc = " \\note_callback"]
12107 #[doc = " \\note_memcpy"]
12108 #[doc = ""]
12109 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12110 #[doc = " ::cudaMemcpy2DFromArray,"]
12111 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12112 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12113 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12114 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12115 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12116 #[doc = " ::cuMemcpy2D,"]
12117 #[doc = " ::cuMemcpy2DUnaligned"]
12118 pub fn cudaMemcpy2DToArray(
12119 dst: cudaArray_t,
12120 wOffset: usize,
12121 hOffset: usize,
12122 src: *const ::libc::c_void,
12123 spitch: usize,
12124 width: usize,
12125 height: usize,
12126 kind: cudaMemcpyKind,
12127 ) -> cudaError_t;
12128}
12129extern "C" {
12130 #[doc = " \\brief Copies data between host and device"]
12131 #[doc = ""]
12132 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the CUDA"]
12133 #[doc = " array \\p src starting at \\p hOffset rows and \\p wOffset bytes from the"]
12134 #[doc = " upper left corner to the memory area pointed to by \\p dst, where"]
12135 #[doc = " \\p kind specifies the direction of the copy, and must be one of"]
12136 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12137 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12138 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12139 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12140 #[doc = " allowed on systems that support unified virtual addressing. \\p dpitch is the"]
12141 #[doc = " width in memory in bytes of the 2D array pointed to by \\p dst, including any"]
12142 #[doc = " padding added to the end of each row. \\p wOffset + \\p width must not exceed"]
12143 #[doc = " the width of the CUDA array \\p src. \\p width must not exceed \\p dpitch."]
12144 #[doc = " ::cudaMemcpy2DFromArray() returns an error if \\p dpitch exceeds the maximum"]
12145 #[doc = " allowed."]
12146 #[doc = ""]
12147 #[doc = " \\param dst - Destination memory address"]
12148 #[doc = " \\param dpitch - Pitch of destination memory"]
12149 #[doc = " \\param src - Source memory address"]
12150 #[doc = " \\param wOffset - Source starting X offset (columns in bytes)"]
12151 #[doc = " \\param hOffset - Source starting Y offset (rows)"]
12152 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12153 #[doc = " \\param height - Height of matrix transfer (rows)"]
12154 #[doc = " \\param kind - Type of transfer"]
12155 #[doc = ""]
12156 #[doc = " \\return"]
12157 #[doc = " ::cudaSuccess,"]
12158 #[doc = " ::cudaErrorInvalidValue,"]
12159 #[doc = " ::cudaErrorInvalidPitchValue,"]
12160 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12161 #[doc = " \\notefnerr"]
12162 #[doc = " \\note_sync"]
12163 #[doc = " \\note_init_rt"]
12164 #[doc = " \\note_callback"]
12165 #[doc = " \\note_memcpy"]
12166 #[doc = ""]
12167 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12168 #[doc = " ::cudaMemcpy2DToArray,"]
12169 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12170 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12171 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12172 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12173 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12174 #[doc = " ::cuMemcpy2D,"]
12175 #[doc = " ::cuMemcpy2DUnaligned"]
12176 pub fn cudaMemcpy2DFromArray(
12177 dst: *mut ::libc::c_void,
12178 dpitch: usize,
12179 src: cudaArray_const_t,
12180 wOffset: usize,
12181 hOffset: usize,
12182 width: usize,
12183 height: usize,
12184 kind: cudaMemcpyKind,
12185 ) -> cudaError_t;
12186}
12187extern "C" {
12188 #[doc = " \\brief Copies data between host and device"]
12189 #[doc = ""]
12190 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the CUDA"]
12191 #[doc = " array \\p src starting at \\p hOffsetSrc rows and \\p wOffsetSrc bytes from the"]
12192 #[doc = " upper left corner to the CUDA array \\p dst starting at \\p hOffsetDst rows"]
12193 #[doc = " and \\p wOffsetDst bytes from the upper left corner, where \\p kind"]
12194 #[doc = " specifies the direction of the copy, and must be one of"]
12195 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12196 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12197 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12198 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12199 #[doc = " allowed on systems that support unified virtual addressing."]
12200 #[doc = " \\p wOffsetDst + \\p width must not exceed the width of the CUDA array \\p dst."]
12201 #[doc = " \\p wOffsetSrc + \\p width must not exceed the width of the CUDA array \\p src."]
12202 #[doc = ""]
12203 #[doc = " \\param dst - Destination memory address"]
12204 #[doc = " \\param wOffsetDst - Destination starting X offset (columns in bytes)"]
12205 #[doc = " \\param hOffsetDst - Destination starting Y offset (rows)"]
12206 #[doc = " \\param src - Source memory address"]
12207 #[doc = " \\param wOffsetSrc - Source starting X offset (columns in bytes)"]
12208 #[doc = " \\param hOffsetSrc - Source starting Y offset (rows)"]
12209 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12210 #[doc = " \\param height - Height of matrix transfer (rows)"]
12211 #[doc = " \\param kind - Type of transfer"]
12212 #[doc = ""]
12213 #[doc = " \\return"]
12214 #[doc = " ::cudaSuccess,"]
12215 #[doc = " ::cudaErrorInvalidValue,"]
12216 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12217 #[doc = " \\notefnerr"]
12218 #[doc = " \\note_sync"]
12219 #[doc = " \\note_init_rt"]
12220 #[doc = " \\note_callback"]
12221 #[doc = ""]
12222 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12223 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12224 #[doc = " ::cudaMemcpyToSymbol,"]
12225 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12226 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12227 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12228 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12229 #[doc = " ::cuMemcpy2D,"]
12230 #[doc = " ::cuMemcpy2DUnaligned"]
12231 pub fn cudaMemcpy2DArrayToArray(
12232 dst: cudaArray_t,
12233 wOffsetDst: usize,
12234 hOffsetDst: usize,
12235 src: cudaArray_const_t,
12236 wOffsetSrc: usize,
12237 hOffsetSrc: usize,
12238 width: usize,
12239 height: usize,
12240 kind: cudaMemcpyKind,
12241 ) -> cudaError_t;
12242}
12243extern "C" {
12244 #[doc = " \\brief Copies data to the given symbol on the device"]
12245 #[doc = ""]
12246 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src"]
12247 #[doc = " to the memory area pointed to by \\p offset bytes from the start of symbol"]
12248 #[doc = " \\p symbol. The memory areas may not overlap. \\p symbol is a variable that"]
12249 #[doc = " resides in global or constant memory space. \\p kind can be either"]
12250 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault."]
12251 #[doc = " Passing ::cudaMemcpyDefault is recommended, in which case the type of"]
12252 #[doc = " transfer is inferred from the pointer values. However, ::cudaMemcpyDefault"]
12253 #[doc = " is only allowed on systems that support unified virtual addressing."]
12254 #[doc = ""]
12255 #[doc = " \\param symbol - Device symbol address"]
12256 #[doc = " \\param src - Source memory address"]
12257 #[doc = " \\param count - Size in bytes to copy"]
12258 #[doc = " \\param offset - Offset from start of symbol in bytes"]
12259 #[doc = " \\param kind - Type of transfer"]
12260 #[doc = ""]
12261 #[doc = " \\return"]
12262 #[doc = " ::cudaSuccess,"]
12263 #[doc = " ::cudaErrorInvalidValue,"]
12264 #[doc = " ::cudaErrorInvalidSymbol,"]
12265 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
12266 #[doc = " ::cudaErrorNoKernelImageForDevice"]
12267 #[doc = " \\notefnerr"]
12268 #[doc = " \\note_sync"]
12269 #[doc = " \\note_string_api_deprecation"]
12270 #[doc = " \\note_init_rt"]
12271 #[doc = " \\note_callback"]
12272 #[doc = ""]
12273 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12274 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12275 #[doc = " ::cudaMemcpy2DArrayToArray,"]
12276 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12277 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12278 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12279 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12280 #[doc = " ::cuMemcpy,"]
12281 #[doc = " ::cuMemcpyHtoD,"]
12282 #[doc = " ::cuMemcpyDtoD"]
12283 pub fn cudaMemcpyToSymbol(
12284 symbol: *const ::libc::c_void,
12285 src: *const ::libc::c_void,
12286 count: usize,
12287 offset: usize,
12288 kind: cudaMemcpyKind,
12289 ) -> cudaError_t;
12290}
12291extern "C" {
12292 #[doc = " \\brief Copies data from the given symbol on the device"]
12293 #[doc = ""]
12294 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p offset bytes"]
12295 #[doc = " from the start of symbol \\p symbol to the memory area pointed to by \\p dst."]
12296 #[doc = " The memory areas may not overlap. \\p symbol is a variable that"]
12297 #[doc = " resides in global or constant memory space. \\p kind can be either"]
12298 #[doc = " ::cudaMemcpyDeviceToHost, ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault."]
12299 #[doc = " Passing ::cudaMemcpyDefault is recommended, in which case the type of"]
12300 #[doc = " transfer is inferred from the pointer values. However, ::cudaMemcpyDefault"]
12301 #[doc = " is only allowed on systems that support unified virtual addressing."]
12302 #[doc = ""]
12303 #[doc = " \\param dst - Destination memory address"]
12304 #[doc = " \\param symbol - Device symbol address"]
12305 #[doc = " \\param count - Size in bytes to copy"]
12306 #[doc = " \\param offset - Offset from start of symbol in bytes"]
12307 #[doc = " \\param kind - Type of transfer"]
12308 #[doc = ""]
12309 #[doc = " \\return"]
12310 #[doc = " ::cudaSuccess,"]
12311 #[doc = " ::cudaErrorInvalidValue,"]
12312 #[doc = " ::cudaErrorInvalidSymbol,"]
12313 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
12314 #[doc = " ::cudaErrorNoKernelImageForDevice"]
12315 #[doc = " \\notefnerr"]
12316 #[doc = " \\note_sync"]
12317 #[doc = " \\note_string_api_deprecation"]
12318 #[doc = " \\note_init_rt"]
12319 #[doc = " \\note_callback"]
12320 #[doc = ""]
12321 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12322 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12323 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12324 #[doc = " ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12325 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12326 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12327 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12328 #[doc = " ::cuMemcpy,"]
12329 #[doc = " ::cuMemcpyDtoH,"]
12330 #[doc = " ::cuMemcpyDtoD"]
12331 pub fn cudaMemcpyFromSymbol(
12332 dst: *mut ::libc::c_void,
12333 symbol: *const ::libc::c_void,
12334 count: usize,
12335 offset: usize,
12336 kind: cudaMemcpyKind,
12337 ) -> cudaError_t;
12338}
12339extern "C" {
12340 #[doc = " \\brief Copies data between host and device"]
12341 #[doc = ""]
12342 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src to the"]
12343 #[doc = " memory area pointed to by \\p dst, where \\p kind specifies the"]
12344 #[doc = " direction of the copy, and must be one of ::cudaMemcpyHostToHost,"]
12345 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12346 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12347 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12348 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12349 #[doc = " allowed on systems that support unified virtual addressing."]
12350 #[doc = ""]
12351 #[doc = " The memory areas may not overlap. Calling ::cudaMemcpyAsync() with \\p dst and"]
12352 #[doc = " \\p src pointers that do not match the direction of the copy results in an"]
12353 #[doc = " undefined behavior."]
12354 #[doc = ""]
12355 #[doc = " ::cudaMemcpyAsync() is asynchronous with respect to the host, so the call"]
12356 #[doc = " may return before the copy is complete. The copy can optionally be"]
12357 #[doc = " associated to a stream by passing a non-zero \\p stream argument. If \\p kind"]
12358 #[doc = " is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and the \\p stream is"]
12359 #[doc = " non-zero, the copy may overlap with operations in other streams."]
12360 #[doc = ""]
12361 #[doc = " The device version of this function only handles device to device copies and"]
12362 #[doc = " cannot be given local or shared pointers."]
12363 #[doc = ""]
12364 #[doc = " \\param dst - Destination memory address"]
12365 #[doc = " \\param src - Source memory address"]
12366 #[doc = " \\param count - Size in bytes to copy"]
12367 #[doc = " \\param kind - Type of transfer"]
12368 #[doc = " \\param stream - Stream identifier"]
12369 #[doc = ""]
12370 #[doc = " \\return"]
12371 #[doc = " ::cudaSuccess,"]
12372 #[doc = " ::cudaErrorInvalidValue,"]
12373 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12374 #[doc = " \\notefnerr"]
12375 #[doc = " \\note_async"]
12376 #[doc = " \\note_null_stream"]
12377 #[doc = " \\note_init_rt"]
12378 #[doc = " \\note_callback"]
12379 #[doc = " \\note_memcpy"]
12380 #[doc = ""]
12381 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12382 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12383 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12384 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpy2DAsync,"]
12385 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12386 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12387 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12388 #[doc = " ::cuMemcpyAsync,"]
12389 #[doc = " ::cuMemcpyDtoHAsync,"]
12390 #[doc = " ::cuMemcpyHtoDAsync,"]
12391 #[doc = " ::cuMemcpyDtoDAsync"]
12392 pub fn cudaMemcpyAsync(
12393 dst: *mut ::libc::c_void,
12394 src: *const ::libc::c_void,
12395 count: usize,
12396 kind: cudaMemcpyKind,
12397 stream: cudaStream_t,
12398 ) -> cudaError_t;
12399}
12400extern "C" {
12401 #[doc = " \\brief Copies memory between two devices asynchronously."]
12402 #[doc = ""]
12403 #[doc = " Copies memory from one device to memory on another device. \\p dst is the"]
12404 #[doc = " base device pointer of the destination memory and \\p dstDevice is the"]
12405 #[doc = " destination device. \\p src is the base device pointer of the source memory"]
12406 #[doc = " and \\p srcDevice is the source device. \\p count specifies the number of bytes"]
12407 #[doc = " to copy."]
12408 #[doc = ""]
12409 #[doc = " Note that this function is asynchronous with respect to the host and all work"]
12410 #[doc = " on other devices."]
12411 #[doc = ""]
12412 #[doc = " \\param dst - Destination device pointer"]
12413 #[doc = " \\param dstDevice - Destination device"]
12414 #[doc = " \\param src - Source device pointer"]
12415 #[doc = " \\param srcDevice - Source device"]
12416 #[doc = " \\param count - Size of memory copy in bytes"]
12417 #[doc = " \\param stream - Stream identifier"]
12418 #[doc = ""]
12419 #[doc = " \\return"]
12420 #[doc = " ::cudaSuccess,"]
12421 #[doc = " ::cudaErrorInvalidValue,"]
12422 #[doc = " ::cudaErrorInvalidDevice"]
12423 #[doc = " \\notefnerr"]
12424 #[doc = " \\note_async"]
12425 #[doc = " \\note_null_stream"]
12426 #[doc = " \\note_init_rt"]
12427 #[doc = " \\note_callback"]
12428 #[doc = ""]
12429 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyPeer, ::cudaMemcpyAsync,"]
12430 #[doc = " ::cudaMemcpy3DPeerAsync,"]
12431 #[doc = " ::cuMemcpyPeerAsync"]
12432 pub fn cudaMemcpyPeerAsync(
12433 dst: *mut ::libc::c_void,
12434 dstDevice: ::libc::c_int,
12435 src: *const ::libc::c_void,
12436 srcDevice: ::libc::c_int,
12437 count: usize,
12438 stream: cudaStream_t,
12439 ) -> cudaError_t;
12440}
12441extern "C" {
12442 #[doc = " \\brief Copies data between host and device"]
12443 #[doc = ""]
12444 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the memory"]
12445 #[doc = " area pointed to by \\p src to the memory area pointed to by \\p dst, where"]
12446 #[doc = " \\p kind specifies the direction of the copy, and must be one of"]
12447 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12448 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12449 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12450 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12451 #[doc = " allowed on systems that support unified virtual addressing."]
12452 #[doc = " \\p dpitch and \\p spitch are the widths in memory in bytes of the 2D arrays"]
12453 #[doc = " pointed to by \\p dst and \\p src, including any padding added to the end of"]
12454 #[doc = " each row. The memory areas may not overlap. \\p width must not exceed either"]
12455 #[doc = " \\p dpitch or \\p spitch."]
12456 #[doc = ""]
12457 #[doc = " Calling ::cudaMemcpy2DAsync() with \\p dst and \\p src pointers that do not"]
12458 #[doc = " match the direction of the copy results in an undefined behavior."]
12459 #[doc = " ::cudaMemcpy2DAsync() returns an error if \\p dpitch or \\p spitch is greater"]
12460 #[doc = " than the maximum allowed."]
12461 #[doc = ""]
12462 #[doc = " ::cudaMemcpy2DAsync() is asynchronous with respect to the host, so"]
12463 #[doc = " the call may return before the copy is complete. The copy can optionally"]
12464 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If"]
12465 #[doc = " \\p kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and"]
12466 #[doc = " \\p stream is non-zero, the copy may overlap with operations in other"]
12467 #[doc = " streams."]
12468 #[doc = ""]
12469 #[doc = " The device version of this function only handles device to device copies and"]
12470 #[doc = " cannot be given local or shared pointers."]
12471 #[doc = ""]
12472 #[doc = " \\param dst - Destination memory address"]
12473 #[doc = " \\param dpitch - Pitch of destination memory"]
12474 #[doc = " \\param src - Source memory address"]
12475 #[doc = " \\param spitch - Pitch of source memory"]
12476 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12477 #[doc = " \\param height - Height of matrix transfer (rows)"]
12478 #[doc = " \\param kind - Type of transfer"]
12479 #[doc = " \\param stream - Stream identifier"]
12480 #[doc = ""]
12481 #[doc = " \\return"]
12482 #[doc = " ::cudaSuccess,"]
12483 #[doc = " ::cudaErrorInvalidValue,"]
12484 #[doc = " ::cudaErrorInvalidPitchValue,"]
12485 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12486 #[doc = " \\notefnerr"]
12487 #[doc = " \\note_async"]
12488 #[doc = " \\note_null_stream"]
12489 #[doc = " \\note_init_rt"]
12490 #[doc = " \\note_callback"]
12491 #[doc = " \\note_memcpy"]
12492 #[doc = ""]
12493 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12494 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12495 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12496 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync,"]
12497 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12498 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12499 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12500 #[doc = " ::cuMemcpy2DAsync"]
12501 pub fn cudaMemcpy2DAsync(
12502 dst: *mut ::libc::c_void,
12503 dpitch: usize,
12504 src: *const ::libc::c_void,
12505 spitch: usize,
12506 width: usize,
12507 height: usize,
12508 kind: cudaMemcpyKind,
12509 stream: cudaStream_t,
12510 ) -> cudaError_t;
12511}
12512extern "C" {
12513 #[doc = " \\brief Copies data between host and device"]
12514 #[doc = ""]
12515 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the memory"]
12516 #[doc = " area pointed to by \\p src to the CUDA array \\p dst starting at \\p hOffset"]
12517 #[doc = " rows and \\p wOffset bytes from the upper left corner, where \\p kind specifies"]
12518 #[doc = " the direction of the copy, and must be one of ::cudaMemcpyHostToHost,"]
12519 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12520 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12521 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12522 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12523 #[doc = " allowed on systems that support unified virtual addressing."]
12524 #[doc = " \\p spitch is the width in memory in bytes of the 2D array pointed to by"]
12525 #[doc = " \\p src, including any padding added to the end of each row. \\p wOffset +"]
12526 #[doc = " \\p width must not exceed the width of the CUDA array \\p dst. \\p width must"]
12527 #[doc = " not exceed \\p spitch. ::cudaMemcpy2DToArrayAsync() returns an error if"]
12528 #[doc = " \\p spitch exceeds the maximum allowed."]
12529 #[doc = ""]
12530 #[doc = " ::cudaMemcpy2DToArrayAsync() is asynchronous with respect to the host, so"]
12531 #[doc = " the call may return before the copy is complete. The copy can optionally"]
12532 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If"]
12533 #[doc = " \\p kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and"]
12534 #[doc = " \\p stream is non-zero, the copy may overlap with operations in other"]
12535 #[doc = " streams."]
12536 #[doc = ""]
12537 #[doc = " \\param dst - Destination memory address"]
12538 #[doc = " \\param wOffset - Destination starting X offset (columns in bytes)"]
12539 #[doc = " \\param hOffset - Destination starting Y offset (rows)"]
12540 #[doc = " \\param src - Source memory address"]
12541 #[doc = " \\param spitch - Pitch of source memory"]
12542 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12543 #[doc = " \\param height - Height of matrix transfer (rows)"]
12544 #[doc = " \\param kind - Type of transfer"]
12545 #[doc = " \\param stream - Stream identifier"]
12546 #[doc = ""]
12547 #[doc = " \\return"]
12548 #[doc = " ::cudaSuccess,"]
12549 #[doc = " ::cudaErrorInvalidValue,"]
12550 #[doc = " ::cudaErrorInvalidPitchValue,"]
12551 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12552 #[doc = " \\notefnerr"]
12553 #[doc = " \\note_async"]
12554 #[doc = " \\note_null_stream"]
12555 #[doc = " \\note_init_rt"]
12556 #[doc = " \\note_callback"]
12557 #[doc = " \\note_memcpy"]
12558 #[doc = ""]
12559 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12560 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12561 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12562 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12563 #[doc = ""]
12564 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12565 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12566 #[doc = " ::cuMemcpy2DAsync"]
12567 pub fn cudaMemcpy2DToArrayAsync(
12568 dst: cudaArray_t,
12569 wOffset: usize,
12570 hOffset: usize,
12571 src: *const ::libc::c_void,
12572 spitch: usize,
12573 width: usize,
12574 height: usize,
12575 kind: cudaMemcpyKind,
12576 stream: cudaStream_t,
12577 ) -> cudaError_t;
12578}
12579extern "C" {
12580 #[doc = " \\brief Copies data between host and device"]
12581 #[doc = ""]
12582 #[doc = " Copies a matrix (\\p height rows of \\p width bytes each) from the CUDA"]
12583 #[doc = " array \\p src starting at \\p hOffset rows and \\p wOffset bytes from the"]
12584 #[doc = " upper left corner to the memory area pointed to by \\p dst,"]
12585 #[doc = " where \\p kind specifies the direction of the copy, and must be one of"]
12586 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
12587 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
12588 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
12589 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12590 #[doc = " allowed on systems that support unified virtual addressing."]
12591 #[doc = " \\p dpitch is the width in memory in bytes of the 2D"]
12592 #[doc = " array pointed to by \\p dst, including any padding added to the end of each"]
12593 #[doc = " row. \\p wOffset + \\p width must not exceed the width of the CUDA array"]
12594 #[doc = " \\p src. \\p width must not exceed \\p dpitch. ::cudaMemcpy2DFromArrayAsync()"]
12595 #[doc = " returns an error if \\p dpitch exceeds the maximum allowed."]
12596 #[doc = ""]
12597 #[doc = " ::cudaMemcpy2DFromArrayAsync() is asynchronous with respect to the host, so"]
12598 #[doc = " the call may return before the copy is complete. The copy can optionally be"]
12599 #[doc = " associated to a stream by passing a non-zero \\p stream argument. If \\p kind"]
12600 #[doc = " is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and \\p stream is"]
12601 #[doc = " non-zero, the copy may overlap with operations in other streams."]
12602 #[doc = ""]
12603 #[doc = " \\param dst - Destination memory address"]
12604 #[doc = " \\param dpitch - Pitch of destination memory"]
12605 #[doc = " \\param src - Source memory address"]
12606 #[doc = " \\param wOffset - Source starting X offset (columns in bytes)"]
12607 #[doc = " \\param hOffset - Source starting Y offset (rows)"]
12608 #[doc = " \\param width - Width of matrix transfer (columns in bytes)"]
12609 #[doc = " \\param height - Height of matrix transfer (rows)"]
12610 #[doc = " \\param kind - Type of transfer"]
12611 #[doc = " \\param stream - Stream identifier"]
12612 #[doc = ""]
12613 #[doc = " \\return"]
12614 #[doc = " ::cudaSuccess,"]
12615 #[doc = " ::cudaErrorInvalidValue,"]
12616 #[doc = " ::cudaErrorInvalidPitchValue,"]
12617 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
12618 #[doc = " \\notefnerr"]
12619 #[doc = " \\note_async"]
12620 #[doc = " \\note_null_stream"]
12621 #[doc = " \\note_init_rt"]
12622 #[doc = " \\note_callback"]
12623 #[doc = " \\note_memcpy"]
12624 #[doc = ""]
12625 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12626 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12627 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12628 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12629 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12630 #[doc = ""]
12631 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
12632 #[doc = " ::cuMemcpy2DAsync"]
12633 pub fn cudaMemcpy2DFromArrayAsync(
12634 dst: *mut ::libc::c_void,
12635 dpitch: usize,
12636 src: cudaArray_const_t,
12637 wOffset: usize,
12638 hOffset: usize,
12639 width: usize,
12640 height: usize,
12641 kind: cudaMemcpyKind,
12642 stream: cudaStream_t,
12643 ) -> cudaError_t;
12644}
12645extern "C" {
12646 #[doc = " \\brief Copies data to the given symbol on the device"]
12647 #[doc = ""]
12648 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src"]
12649 #[doc = " to the memory area pointed to by \\p offset bytes from the start of symbol"]
12650 #[doc = " \\p symbol. The memory areas may not overlap. \\p symbol is a variable that"]
12651 #[doc = " resides in global or constant memory space. \\p kind can be either"]
12652 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault."]
12653 #[doc = " Passing ::cudaMemcpyDefault is recommended, in which case the type of transfer"]
12654 #[doc = " is inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12655 #[doc = " allowed on systems that support unified virtual addressing."]
12656 #[doc = ""]
12657 #[doc = " ::cudaMemcpyToSymbolAsync() is asynchronous with respect to the host, so"]
12658 #[doc = " the call may return before the copy is complete. The copy can optionally"]
12659 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If"]
12660 #[doc = " \\p kind is ::cudaMemcpyHostToDevice and \\p stream is non-zero, the copy"]
12661 #[doc = " may overlap with operations in other streams."]
12662 #[doc = ""]
12663 #[doc = " \\param symbol - Device symbol address"]
12664 #[doc = " \\param src - Source memory address"]
12665 #[doc = " \\param count - Size in bytes to copy"]
12666 #[doc = " \\param offset - Offset from start of symbol in bytes"]
12667 #[doc = " \\param kind - Type of transfer"]
12668 #[doc = " \\param stream - Stream identifier"]
12669 #[doc = ""]
12670 #[doc = " \\return"]
12671 #[doc = " ::cudaSuccess,"]
12672 #[doc = " ::cudaErrorInvalidValue,"]
12673 #[doc = " ::cudaErrorInvalidSymbol,"]
12674 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
12675 #[doc = " ::cudaErrorNoKernelImageForDevice"]
12676 #[doc = " \\notefnerr"]
12677 #[doc = " \\note_async"]
12678 #[doc = " \\note_null_stream"]
12679 #[doc = " \\note_string_api_deprecation"]
12680 #[doc = " \\note_init_rt"]
12681 #[doc = " \\note_callback"]
12682 #[doc = ""]
12683 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12684 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12685 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12686 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12687 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12688 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12689 #[doc = " ::cudaMemcpyFromSymbolAsync,"]
12690 #[doc = " ::cuMemcpyAsync,"]
12691 #[doc = " ::cuMemcpyHtoDAsync,"]
12692 #[doc = " ::cuMemcpyDtoDAsync"]
12693 pub fn cudaMemcpyToSymbolAsync(
12694 symbol: *const ::libc::c_void,
12695 src: *const ::libc::c_void,
12696 count: usize,
12697 offset: usize,
12698 kind: cudaMemcpyKind,
12699 stream: cudaStream_t,
12700 ) -> cudaError_t;
12701}
12702extern "C" {
12703 #[doc = " \\brief Copies data from the given symbol on the device"]
12704 #[doc = ""]
12705 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p offset bytes"]
12706 #[doc = " from the start of symbol \\p symbol to the memory area pointed to by \\p dst."]
12707 #[doc = " The memory areas may not overlap. \\p symbol is a variable that resides in"]
12708 #[doc = " global or constant memory space. \\p kind can be either"]
12709 #[doc = " ::cudaMemcpyDeviceToHost, ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault."]
12710 #[doc = " Passing ::cudaMemcpyDefault is recommended, in which case the type of transfer"]
12711 #[doc = " is inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
12712 #[doc = " allowed on systems that support unified virtual addressing."]
12713 #[doc = ""]
12714 #[doc = " ::cudaMemcpyFromSymbolAsync() is asynchronous with respect to the host, so"]
12715 #[doc = " the call may return before the copy is complete. The copy can optionally be"]
12716 #[doc = " associated to a stream by passing a non-zero \\p stream argument. If \\p kind"]
12717 #[doc = " is ::cudaMemcpyDeviceToHost and \\p stream is non-zero, the copy may overlap"]
12718 #[doc = " with operations in other streams."]
12719 #[doc = ""]
12720 #[doc = " \\param dst - Destination memory address"]
12721 #[doc = " \\param symbol - Device symbol address"]
12722 #[doc = " \\param count - Size in bytes to copy"]
12723 #[doc = " \\param offset - Offset from start of symbol in bytes"]
12724 #[doc = " \\param kind - Type of transfer"]
12725 #[doc = " \\param stream - Stream identifier"]
12726 #[doc = ""]
12727 #[doc = " \\return"]
12728 #[doc = " ::cudaSuccess,"]
12729 #[doc = " ::cudaErrorInvalidValue,"]
12730 #[doc = " ::cudaErrorInvalidSymbol,"]
12731 #[doc = " ::cudaErrorInvalidMemcpyDirection,"]
12732 #[doc = " ::cudaErrorNoKernelImageForDevice"]
12733 #[doc = " \\notefnerr"]
12734 #[doc = " \\note_async"]
12735 #[doc = " \\note_null_stream"]
12736 #[doc = " \\note_string_api_deprecation"]
12737 #[doc = " \\note_init_rt"]
12738 #[doc = " \\note_callback"]
12739 #[doc = ""]
12740 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
12741 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
12742 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
12743 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
12744 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
12745 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
12746 #[doc = " ::cudaMemcpyToSymbolAsync,"]
12747 #[doc = " ::cuMemcpyAsync,"]
12748 #[doc = " ::cuMemcpyDtoHAsync,"]
12749 #[doc = " ::cuMemcpyDtoDAsync"]
12750 pub fn cudaMemcpyFromSymbolAsync(
12751 dst: *mut ::libc::c_void,
12752 symbol: *const ::libc::c_void,
12753 count: usize,
12754 offset: usize,
12755 kind: cudaMemcpyKind,
12756 stream: cudaStream_t,
12757 ) -> cudaError_t;
12758}
12759extern "C" {
12760 #[doc = " \\brief Initializes or sets device memory to a value"]
12761 #[doc = ""]
12762 #[doc = " Fills the first \\p count bytes of the memory area pointed to by \\p devPtr"]
12763 #[doc = " with the constant byte value \\p value."]
12764 #[doc = ""]
12765 #[doc = " Note that this function is asynchronous with respect to the host unless"]
12766 #[doc = " \\p devPtr refers to pinned host memory."]
12767 #[doc = ""]
12768 #[doc = " \\param devPtr - Pointer to device memory"]
12769 #[doc = " \\param value - Value to set for each byte of specified memory"]
12770 #[doc = " \\param count - Size in bytes to set"]
12771 #[doc = ""]
12772 #[doc = " \\return"]
12773 #[doc = " ::cudaSuccess,"]
12774 #[doc = " ::cudaErrorInvalidValue,"]
12775 #[doc = " \\notefnerr"]
12776 #[doc = " \\note_memset"]
12777 #[doc = " \\note_init_rt"]
12778 #[doc = " \\note_callback"]
12779 #[doc = ""]
12780 #[doc = " \\sa"]
12781 #[doc = " ::cuMemsetD8,"]
12782 #[doc = " ::cuMemsetD16,"]
12783 #[doc = " ::cuMemsetD32"]
12784 pub fn cudaMemset(
12785 devPtr: *mut ::libc::c_void,
12786 value: ::libc::c_int,
12787 count: usize,
12788 ) -> cudaError_t;
12789}
12790extern "C" {
12791 #[doc = " \\brief Initializes or sets device memory to a value"]
12792 #[doc = ""]
12793 #[doc = " Sets to the specified value \\p value a matrix (\\p height rows of \\p width"]
12794 #[doc = " bytes each) pointed to by \\p dstPtr. \\p pitch is the width in bytes of the"]
12795 #[doc = " 2D array pointed to by \\p dstPtr, including any padding added to the end"]
12796 #[doc = " of each row. This function performs fastest when the pitch is one that has"]
12797 #[doc = " been passed back by ::cudaMallocPitch()."]
12798 #[doc = ""]
12799 #[doc = " Note that this function is asynchronous with respect to the host unless"]
12800 #[doc = " \\p devPtr refers to pinned host memory."]
12801 #[doc = ""]
12802 #[doc = " \\param devPtr - Pointer to 2D device memory"]
12803 #[doc = " \\param pitch - Pitch in bytes of 2D device memory(Unused if \\p height is 1)"]
12804 #[doc = " \\param value - Value to set for each byte of specified memory"]
12805 #[doc = " \\param width - Width of matrix set (columns in bytes)"]
12806 #[doc = " \\param height - Height of matrix set (rows)"]
12807 #[doc = ""]
12808 #[doc = " \\return"]
12809 #[doc = " ::cudaSuccess,"]
12810 #[doc = " ::cudaErrorInvalidValue,"]
12811 #[doc = " \\notefnerr"]
12812 #[doc = " \\note_memset"]
12813 #[doc = " \\note_init_rt"]
12814 #[doc = " \\note_callback"]
12815 #[doc = ""]
12816 #[doc = " \\sa ::cudaMemset, ::cudaMemset3D, ::cudaMemsetAsync,"]
12817 #[doc = " ::cudaMemset2DAsync, ::cudaMemset3DAsync,"]
12818 #[doc = " ::cuMemsetD2D8,"]
12819 #[doc = " ::cuMemsetD2D16,"]
12820 #[doc = " ::cuMemsetD2D32"]
12821 pub fn cudaMemset2D(
12822 devPtr: *mut ::libc::c_void,
12823 pitch: usize,
12824 value: ::libc::c_int,
12825 width: usize,
12826 height: usize,
12827 ) -> cudaError_t;
12828}
12829extern "C" {
12830 #[doc = " \\brief Initializes or sets device memory to a value"]
12831 #[doc = ""]
12832 #[doc = " Initializes each element of a 3D array to the specified value \\p value."]
12833 #[doc = " The object to initialize is defined by \\p pitchedDevPtr. The \\p pitch field"]
12834 #[doc = " of \\p pitchedDevPtr is the width in memory in bytes of the 3D array pointed"]
12835 #[doc = " to by \\p pitchedDevPtr, including any padding added to the end of each row."]
12836 #[doc = " The \\p xsize field specifies the logical width of each row in bytes, while"]
12837 #[doc = " the \\p ysize field specifies the height of each 2D slice in rows."]
12838 #[doc = " The \\p pitch field of \\p pitchedDevPtr is ignored when \\p height and \\p depth"]
12839 #[doc = " are both equal to 1."]
12840 #[doc = ""]
12841 #[doc = " The extents of the initialized region are specified as a \\p width in bytes,"]
12842 #[doc = " a \\p height in rows, and a \\p depth in slices."]
12843 #[doc = ""]
12844 #[doc = " Extents with \\p width greater than or equal to the \\p xsize of"]
12845 #[doc = " \\p pitchedDevPtr may perform significantly faster than extents narrower"]
12846 #[doc = " than the \\p xsize. Secondarily, extents with \\p height equal to the"]
12847 #[doc = " \\p ysize of \\p pitchedDevPtr will perform faster than when the \\p height is"]
12848 #[doc = " shorter than the \\p ysize."]
12849 #[doc = ""]
12850 #[doc = " This function performs fastest when the \\p pitchedDevPtr has been allocated"]
12851 #[doc = " by ::cudaMalloc3D()."]
12852 #[doc = ""]
12853 #[doc = " Note that this function is asynchronous with respect to the host unless"]
12854 #[doc = " \\p pitchedDevPtr refers to pinned host memory."]
12855 #[doc = ""]
12856 #[doc = " \\param pitchedDevPtr - Pointer to pitched device memory"]
12857 #[doc = " \\param value - Value to set for each byte of specified memory"]
12858 #[doc = " \\param extent - Size parameters for where to set device memory (\\p width field in bytes)"]
12859 #[doc = ""]
12860 #[doc = " \\return"]
12861 #[doc = " ::cudaSuccess,"]
12862 #[doc = " ::cudaErrorInvalidValue,"]
12863 #[doc = " \\notefnerr"]
12864 #[doc = " \\note_memset"]
12865 #[doc = " \\note_init_rt"]
12866 #[doc = " \\note_callback"]
12867 #[doc = ""]
12868 #[doc = " \\sa ::cudaMemset, ::cudaMemset2D,"]
12869 #[doc = " ::cudaMemsetAsync, ::cudaMemset2DAsync, ::cudaMemset3DAsync,"]
12870 #[doc = " ::cudaMalloc3D, ::make_cudaPitchedPtr,"]
12871 #[doc = " ::make_cudaExtent"]
12872 pub fn cudaMemset3D(
12873 pitchedDevPtr: cudaPitchedPtr,
12874 value: ::libc::c_int,
12875 extent: cudaExtent,
12876 ) -> cudaError_t;
12877}
12878extern "C" {
12879 #[doc = " \\brief Initializes or sets device memory to a value"]
12880 #[doc = ""]
12881 #[doc = " Fills the first \\p count bytes of the memory area pointed to by \\p devPtr"]
12882 #[doc = " with the constant byte value \\p value."]
12883 #[doc = ""]
12884 #[doc = " ::cudaMemsetAsync() is asynchronous with respect to the host, so"]
12885 #[doc = " the call may return before the memset is complete. The operation can optionally"]
12886 #[doc = " be associated to a stream by passing a non-zero \\p stream argument."]
12887 #[doc = " If \\p stream is non-zero, the operation may overlap with operations in other streams."]
12888 #[doc = ""]
12889 #[doc = " The device version of this function only handles device to device copies and"]
12890 #[doc = " cannot be given local or shared pointers."]
12891 #[doc = ""]
12892 #[doc = " \\param devPtr - Pointer to device memory"]
12893 #[doc = " \\param value - Value to set for each byte of specified memory"]
12894 #[doc = " \\param count - Size in bytes to set"]
12895 #[doc = " \\param stream - Stream identifier"]
12896 #[doc = ""]
12897 #[doc = " \\return"]
12898 #[doc = " ::cudaSuccess,"]
12899 #[doc = " ::cudaErrorInvalidValue,"]
12900 #[doc = " \\notefnerr"]
12901 #[doc = " \\note_memset"]
12902 #[doc = " \\note_null_stream"]
12903 #[doc = " \\note_init_rt"]
12904 #[doc = " \\note_callback"]
12905 #[doc = ""]
12906 #[doc = " \\sa ::cudaMemset, ::cudaMemset2D, ::cudaMemset3D,"]
12907 #[doc = " ::cudaMemset2DAsync, ::cudaMemset3DAsync,"]
12908 #[doc = " ::cuMemsetD8Async,"]
12909 #[doc = " ::cuMemsetD16Async,"]
12910 #[doc = " ::cuMemsetD32Async"]
12911 pub fn cudaMemsetAsync(
12912 devPtr: *mut ::libc::c_void,
12913 value: ::libc::c_int,
12914 count: usize,
12915 stream: cudaStream_t,
12916 ) -> cudaError_t;
12917}
12918extern "C" {
12919 #[doc = " \\brief Initializes or sets device memory to a value"]
12920 #[doc = ""]
12921 #[doc = " Sets to the specified value \\p value a matrix (\\p height rows of \\p width"]
12922 #[doc = " bytes each) pointed to by \\p dstPtr. \\p pitch is the width in bytes of the"]
12923 #[doc = " 2D array pointed to by \\p dstPtr, including any padding added to the end"]
12924 #[doc = " of each row. This function performs fastest when the pitch is one that has"]
12925 #[doc = " been passed back by ::cudaMallocPitch()."]
12926 #[doc = ""]
12927 #[doc = " ::cudaMemset2DAsync() is asynchronous with respect to the host, so"]
12928 #[doc = " the call may return before the memset is complete. The operation can optionally"]
12929 #[doc = " be associated to a stream by passing a non-zero \\p stream argument."]
12930 #[doc = " If \\p stream is non-zero, the operation may overlap with operations in other streams."]
12931 #[doc = ""]
12932 #[doc = " The device version of this function only handles device to device copies and"]
12933 #[doc = " cannot be given local or shared pointers."]
12934 #[doc = ""]
12935 #[doc = " \\param devPtr - Pointer to 2D device memory"]
12936 #[doc = " \\param pitch - Pitch in bytes of 2D device memory(Unused if \\p height is 1)"]
12937 #[doc = " \\param value - Value to set for each byte of specified memory"]
12938 #[doc = " \\param width - Width of matrix set (columns in bytes)"]
12939 #[doc = " \\param height - Height of matrix set (rows)"]
12940 #[doc = " \\param stream - Stream identifier"]
12941 #[doc = ""]
12942 #[doc = " \\return"]
12943 #[doc = " ::cudaSuccess,"]
12944 #[doc = " ::cudaErrorInvalidValue,"]
12945 #[doc = " \\notefnerr"]
12946 #[doc = " \\note_memset"]
12947 #[doc = " \\note_null_stream"]
12948 #[doc = " \\note_init_rt"]
12949 #[doc = " \\note_callback"]
12950 #[doc = ""]
12951 #[doc = " \\sa ::cudaMemset, ::cudaMemset2D, ::cudaMemset3D,"]
12952 #[doc = " ::cudaMemsetAsync, ::cudaMemset3DAsync,"]
12953 #[doc = " ::cuMemsetD2D8Async,"]
12954 #[doc = " ::cuMemsetD2D16Async,"]
12955 #[doc = " ::cuMemsetD2D32Async"]
12956 pub fn cudaMemset2DAsync(
12957 devPtr: *mut ::libc::c_void,
12958 pitch: usize,
12959 value: ::libc::c_int,
12960 width: usize,
12961 height: usize,
12962 stream: cudaStream_t,
12963 ) -> cudaError_t;
12964}
12965extern "C" {
12966 #[doc = " \\brief Initializes or sets device memory to a value"]
12967 #[doc = ""]
12968 #[doc = " Initializes each element of a 3D array to the specified value \\p value."]
12969 #[doc = " The object to initialize is defined by \\p pitchedDevPtr. The \\p pitch field"]
12970 #[doc = " of \\p pitchedDevPtr is the width in memory in bytes of the 3D array pointed"]
12971 #[doc = " to by \\p pitchedDevPtr, including any padding added to the end of each row."]
12972 #[doc = " The \\p xsize field specifies the logical width of each row in bytes, while"]
12973 #[doc = " the \\p ysize field specifies the height of each 2D slice in rows."]
12974 #[doc = " The \\p pitch field of \\p pitchedDevPtr is ignored when \\p height and \\p depth"]
12975 #[doc = " are both equal to 1."]
12976 #[doc = ""]
12977 #[doc = " The extents of the initialized region are specified as a \\p width in bytes,"]
12978 #[doc = " a \\p height in rows, and a \\p depth in slices."]
12979 #[doc = ""]
12980 #[doc = " Extents with \\p width greater than or equal to the \\p xsize of"]
12981 #[doc = " \\p pitchedDevPtr may perform significantly faster than extents narrower"]
12982 #[doc = " than the \\p xsize. Secondarily, extents with \\p height equal to the"]
12983 #[doc = " \\p ysize of \\p pitchedDevPtr will perform faster than when the \\p height is"]
12984 #[doc = " shorter than the \\p ysize."]
12985 #[doc = ""]
12986 #[doc = " This function performs fastest when the \\p pitchedDevPtr has been allocated"]
12987 #[doc = " by ::cudaMalloc3D()."]
12988 #[doc = ""]
12989 #[doc = " ::cudaMemset3DAsync() is asynchronous with respect to the host, so"]
12990 #[doc = " the call may return before the memset is complete. The operation can optionally"]
12991 #[doc = " be associated to a stream by passing a non-zero \\p stream argument."]
12992 #[doc = " If \\p stream is non-zero, the operation may overlap with operations in other streams."]
12993 #[doc = ""]
12994 #[doc = " The device version of this function only handles device to device copies and"]
12995 #[doc = " cannot be given local or shared pointers."]
12996 #[doc = ""]
12997 #[doc = " \\param pitchedDevPtr - Pointer to pitched device memory"]
12998 #[doc = " \\param value - Value to set for each byte of specified memory"]
12999 #[doc = " \\param extent - Size parameters for where to set device memory (\\p width field in bytes)"]
13000 #[doc = " \\param stream - Stream identifier"]
13001 #[doc = ""]
13002 #[doc = " \\return"]
13003 #[doc = " ::cudaSuccess,"]
13004 #[doc = " ::cudaErrorInvalidValue,"]
13005 #[doc = " \\notefnerr"]
13006 #[doc = " \\note_memset"]
13007 #[doc = " \\note_null_stream"]
13008 #[doc = " \\note_init_rt"]
13009 #[doc = " \\note_callback"]
13010 #[doc = ""]
13011 #[doc = " \\sa ::cudaMemset, ::cudaMemset2D, ::cudaMemset3D,"]
13012 #[doc = " ::cudaMemsetAsync, ::cudaMemset2DAsync,"]
13013 #[doc = " ::cudaMalloc3D, ::make_cudaPitchedPtr,"]
13014 #[doc = " ::make_cudaExtent"]
13015 pub fn cudaMemset3DAsync(
13016 pitchedDevPtr: cudaPitchedPtr,
13017 value: ::libc::c_int,
13018 extent: cudaExtent,
13019 stream: cudaStream_t,
13020 ) -> cudaError_t;
13021}
13022extern "C" {
13023 #[doc = " \\brief Finds the address associated with a CUDA symbol"]
13024 #[doc = ""]
13025 #[doc = " Returns in \\p *devPtr the address of symbol \\p symbol on the device."]
13026 #[doc = " \\p symbol is a variable that resides in global or constant memory space."]
13027 #[doc = " If \\p symbol cannot be found, or if \\p symbol is not declared in the"]
13028 #[doc = " global or constant memory space, \\p *devPtr is unchanged and the error"]
13029 #[doc = " ::cudaErrorInvalidSymbol is returned."]
13030 #[doc = ""]
13031 #[doc = " \\param devPtr - Return device pointer associated with symbol"]
13032 #[doc = " \\param symbol - Device symbol address"]
13033 #[doc = ""]
13034 #[doc = " \\return"]
13035 #[doc = " ::cudaSuccess,"]
13036 #[doc = " ::cudaErrorInvalidSymbol,"]
13037 #[doc = " ::cudaErrorNoKernelImageForDevice"]
13038 #[doc = " \\notefnerr"]
13039 #[doc = " \\note_string_api_deprecation"]
13040 #[doc = " \\note_init_rt"]
13041 #[doc = " \\note_callback"]
13042 #[doc = ""]
13043 #[doc = " \\sa"]
13044 #[doc = " \\ref ::cudaGetSymbolAddress(void**, const T&) \"cudaGetSymbolAddress (C++ API)\","]
13045 #[doc = " \\ref ::cudaGetSymbolSize(size_t*, const void*) \"cudaGetSymbolSize (C API)\","]
13046 #[doc = " ::cuModuleGetGlobal"]
13047 pub fn cudaGetSymbolAddress(
13048 devPtr: *mut *mut ::libc::c_void,
13049 symbol: *const ::libc::c_void,
13050 ) -> cudaError_t;
13051}
13052extern "C" {
13053 #[doc = " \\brief Finds the size of the object associated with a CUDA symbol"]
13054 #[doc = ""]
13055 #[doc = " Returns in \\p *size the size of symbol \\p symbol. \\p symbol is a variable that"]
13056 #[doc = " resides in global or constant memory space. If \\p symbol cannot be found, or"]
13057 #[doc = " if \\p symbol is not declared in global or constant memory space, \\p *size is"]
13058 #[doc = " unchanged and the error ::cudaErrorInvalidSymbol is returned."]
13059 #[doc = ""]
13060 #[doc = " \\param size - Size of object associated with symbol"]
13061 #[doc = " \\param symbol - Device symbol address"]
13062 #[doc = ""]
13063 #[doc = " \\return"]
13064 #[doc = " ::cudaSuccess,"]
13065 #[doc = " ::cudaErrorInvalidSymbol,"]
13066 #[doc = " ::cudaErrorNoKernelImageForDevice"]
13067 #[doc = " \\notefnerr"]
13068 #[doc = " \\note_string_api_deprecation"]
13069 #[doc = " \\note_init_rt"]
13070 #[doc = " \\note_callback"]
13071 #[doc = ""]
13072 #[doc = " \\sa"]
13073 #[doc = " \\ref ::cudaGetSymbolAddress(void**, const void*) \"cudaGetSymbolAddress (C API)\","]
13074 #[doc = " \\ref ::cudaGetSymbolSize(size_t*, const T&) \"cudaGetSymbolSize (C++ API)\","]
13075 #[doc = " ::cuModuleGetGlobal"]
13076 pub fn cudaGetSymbolSize(size: *mut usize, symbol: *const ::libc::c_void) -> cudaError_t;
13077}
13078extern "C" {
13079 #[doc = " \\brief Prefetches memory to the specified destination device"]
13080 #[doc = ""]
13081 #[doc = " Prefetches memory to the specified destination device. \\p devPtr is the"]
13082 #[doc = " base device pointer of the memory to be prefetched and \\p dstDevice is the"]
13083 #[doc = " destination device. \\p count specifies the number of bytes to copy. \\p stream"]
13084 #[doc = " is the stream in which the operation is enqueued. The memory range must refer"]
13085 #[doc = " to managed memory allocated via ::cudaMallocManaged or declared via __managed__ variables."]
13086 #[doc = ""]
13087 #[doc = " Passing in cudaCpuDeviceId for \\p dstDevice will prefetch the data to host memory. If"]
13088 #[doc = " \\p dstDevice is a GPU, then the device attribute ::cudaDevAttrConcurrentManagedAccess"]
13089 #[doc = " must be non-zero. Additionally, \\p stream must be associated with a device that has a"]
13090 #[doc = " non-zero value for the device attribute ::cudaDevAttrConcurrentManagedAccess."]
13091 #[doc = ""]
13092 #[doc = " The start address and end address of the memory range will be rounded down and rounded up"]
13093 #[doc = " respectively to be aligned to CPU page size before the prefetch operation is enqueued"]
13094 #[doc = " in the stream."]
13095 #[doc = ""]
13096 #[doc = " If no physical memory has been allocated for this region, then this memory region"]
13097 #[doc = " will be populated and mapped on the destination device. If there's insufficient"]
13098 #[doc = " memory to prefetch the desired region, the Unified Memory driver may evict pages from other"]
13099 #[doc = " ::cudaMallocManaged allocations to host memory in order to make room. Device memory"]
13100 #[doc = " allocated using ::cudaMalloc or ::cudaMallocArray will not be evicted."]
13101 #[doc = ""]
13102 #[doc = " By default, any mappings to the previous location of the migrated pages are removed and"]
13103 #[doc = " mappings for the new location are only setup on \\p dstDevice. The exact behavior however"]
13104 #[doc = " also depends on the settings applied to this memory range via ::cudaMemAdvise as described"]
13105 #[doc = " below:"]
13106 #[doc = ""]
13107 #[doc = " If ::cudaMemAdviseSetReadMostly was set on any subset of this memory range,"]
13108 #[doc = " then that subset will create a read-only copy of the pages on \\p dstDevice."]
13109 #[doc = ""]
13110 #[doc = " If ::cudaMemAdviseSetPreferredLocation was called on any subset of this memory"]
13111 #[doc = " range, then the pages will be migrated to \\p dstDevice even if \\p dstDevice is not the"]
13112 #[doc = " preferred location of any pages in the memory range."]
13113 #[doc = ""]
13114 #[doc = " If ::cudaMemAdviseSetAccessedBy was called on any subset of this memory range,"]
13115 #[doc = " then mappings to those pages from all the appropriate processors are updated to"]
13116 #[doc = " refer to the new location if establishing such a mapping is possible. Otherwise,"]
13117 #[doc = " those mappings are cleared."]
13118 #[doc = ""]
13119 #[doc = " Note that this API is not required for functionality and only serves to improve performance"]
13120 #[doc = " by allowing the application to migrate data to a suitable location before it is accessed."]
13121 #[doc = " Memory accesses to this range are always coherent and are allowed even when the data is"]
13122 #[doc = " actively being migrated."]
13123 #[doc = ""]
13124 #[doc = " Note that this function is asynchronous with respect to the host and all work"]
13125 #[doc = " on other devices."]
13126 #[doc = ""]
13127 #[doc = " \\param devPtr - Pointer to be prefetched"]
13128 #[doc = " \\param count - Size in bytes"]
13129 #[doc = " \\param dstDevice - Destination device to prefetch to"]
13130 #[doc = " \\param stream - Stream to enqueue prefetch operation"]
13131 #[doc = ""]
13132 #[doc = " \\return"]
13133 #[doc = " ::cudaSuccess,"]
13134 #[doc = " ::cudaErrorInvalidValue,"]
13135 #[doc = " ::cudaErrorInvalidDevice"]
13136 #[doc = " \\notefnerr"]
13137 #[doc = " \\note_async"]
13138 #[doc = " \\note_null_stream"]
13139 #[doc = " \\note_init_rt"]
13140 #[doc = " \\note_callback"]
13141 #[doc = ""]
13142 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyPeer, ::cudaMemcpyAsync,"]
13143 #[doc = " ::cudaMemcpy3DPeerAsync, ::cudaMemAdvise,"]
13144 #[doc = " ::cuMemPrefetchAsync"]
13145 pub fn cudaMemPrefetchAsync(
13146 devPtr: *const ::libc::c_void,
13147 count: usize,
13148 dstDevice: ::libc::c_int,
13149 stream: cudaStream_t,
13150 ) -> cudaError_t;
13151}
13152extern "C" {
13153 #[doc = " \\brief Advise about the usage of a given memory range"]
13154 #[doc = ""]
13155 #[doc = " Advise the Unified Memory subsystem about the usage pattern for the memory range"]
13156 #[doc = " starting at \\p devPtr with a size of \\p count bytes. The start address and end address of the memory"]
13157 #[doc = " range will be rounded down and rounded up respectively to be aligned to CPU page size before the"]
13158 #[doc = " advice is applied. The memory range must refer to managed memory allocated via ::cudaMallocManaged"]
13159 #[doc = " or declared via __managed__ variables. The memory range could also refer to system-allocated pageable"]
13160 #[doc = " memory provided it represents a valid, host-accessible region of memory and all additional constraints"]
13161 #[doc = " imposed by \\p advice as outlined below are also satisfied. Specifying an invalid system-allocated pageable"]
13162 #[doc = " memory range results in an error being returned."]
13163 #[doc = ""]
13164 #[doc = " The \\p advice parameter can take the following values:"]
13165 #[doc = " - ::cudaMemAdviseSetReadMostly: This implies that the data is mostly going to be read"]
13166 #[doc = " from and only occasionally written to. Any read accesses from any processor to this region will create a"]
13167 #[doc = " read-only copy of at least the accessed pages in that processor's memory. Additionally, if ::cudaMemPrefetchAsync"]
13168 #[doc = " is called on this region, it will create a read-only copy of the data on the destination processor."]
13169 #[doc = " If any processor writes to this region, all copies of the corresponding page will be invalidated"]
13170 #[doc = " except for the one where the write occurred. The \\p device argument is ignored for this advice."]
13171 #[doc = " Note that for a page to be read-duplicated, the accessing processor must either be the CPU or a GPU"]
13172 #[doc = " that has a non-zero value for the device attribute ::cudaDevAttrConcurrentManagedAccess."]
13173 #[doc = " Also, if a context is created on a device that does not have the device attribute"]
13174 #[doc = " ::cudaDevAttrConcurrentManagedAccess set, then read-duplication will not occur until"]
13175 #[doc = " all such contexts are destroyed."]
13176 #[doc = " If the memory region refers to valid system-allocated pageable memory, then the accessing device must"]
13177 #[doc = " have a non-zero value for the device attribute ::cudaDevAttrPageableMemoryAccess for a read-only"]
13178 #[doc = " copy to be created on that device. Note however that if the accessing device also has a non-zero value for the"]
13179 #[doc = " device attribute ::cudaDevAttrPageableMemoryAccessUsesHostPageTables, then setting this advice"]
13180 #[doc = " will not create a read-only copy when that device accesses this memory region."]
13181 #[doc = ""]
13182 #[doc = " - ::cudaMemAdviceUnsetReadMostly: Undoes the effect of ::cudaMemAdviceReadMostly and also prevents the"]
13183 #[doc = " Unified Memory driver from attempting heuristic read-duplication on the memory range. Any read-duplicated"]
13184 #[doc = " copies of the data will be collapsed into a single copy. The location for the collapsed"]
13185 #[doc = " copy will be the preferred location if the page has a preferred location and one of the read-duplicated"]
13186 #[doc = " copies was resident at that location. Otherwise, the location chosen is arbitrary."]
13187 #[doc = ""]
13188 #[doc = " - ::cudaMemAdviseSetPreferredLocation: This advice sets the preferred location for the"]
13189 #[doc = " data to be the memory belonging to \\p device. Passing in cudaCpuDeviceId for \\p device sets the"]
13190 #[doc = " preferred location as host memory. If \\p device is a GPU, then it must have a non-zero value for the"]
13191 #[doc = " device attribute ::cudaDevAttrConcurrentManagedAccess. Setting the preferred location"]
13192 #[doc = " does not cause data to migrate to that location immediately. Instead, it guides the migration policy"]
13193 #[doc = " when a fault occurs on that memory region. If the data is already in its preferred location and the"]
13194 #[doc = " faulting processor can establish a mapping without requiring the data to be migrated, then"]
13195 #[doc = " data migration will be avoided. On the other hand, if the data is not in its preferred location"]
13196 #[doc = " or if a direct mapping cannot be established, then it will be migrated to the processor accessing"]
13197 #[doc = " it. It is important to note that setting the preferred location does not prevent data prefetching"]
13198 #[doc = " done using ::cudaMemPrefetchAsync."]
13199 #[doc = " Having a preferred location can override the page thrash detection and resolution logic in the Unified"]
13200 #[doc = " Memory driver. Normally, if a page is detected to be constantly thrashing between for example host and device"]
13201 #[doc = " memory, the page may eventually be pinned to host memory by the Unified Memory driver. But"]
13202 #[doc = " if the preferred location is set as device memory, then the page will continue to thrash indefinitely."]
13203 #[doc = " If ::cudaMemAdviseSetReadMostly is also set on this memory region or any subset of it, then the"]
13204 #[doc = " policies associated with that advice will override the policies of this advice, unless read accesses from"]
13205 #[doc = " \\p device will not result in a read-only copy being created on that device as outlined in description for"]
13206 #[doc = " the advice ::cudaMemAdviseSetReadMostly."]
13207 #[doc = " If the memory region refers to valid system-allocated pageable memory, then \\p device must have a non-zero"]
13208 #[doc = " value for the device attribute ::cudaDevAttrPageableMemoryAccess. Additionally, if \\p device has"]
13209 #[doc = " a non-zero value for the device attribute ::cudaDevAttrPageableMemoryAccessUsesHostPageTables,"]
13210 #[doc = " then this call has no effect. Note however that this behavior may change in the future."]
13211 #[doc = ""]
13212 #[doc = " - ::cudaMemAdviseUnsetPreferredLocation: Undoes the effect of ::cudaMemAdviseSetPreferredLocation"]
13213 #[doc = " and changes the preferred location to none."]
13214 #[doc = ""]
13215 #[doc = " - ::cudaMemAdviseSetAccessedBy: This advice implies that the data will be accessed by \\p device."]
13216 #[doc = " Passing in ::cudaCpuDeviceId for \\p device will set the advice for the CPU. If \\p device is a GPU, then"]
13217 #[doc = " the device attribute ::cudaDevAttrConcurrentManagedAccess must be non-zero."]
13218 #[doc = " This advice does not cause data migration and has no impact on the location of the data per se. Instead,"]
13219 #[doc = " it causes the data to always be mapped in the specified processor's page tables, as long as the"]
13220 #[doc = " location of the data permits a mapping to be established. If the data gets migrated for any reason,"]
13221 #[doc = " the mappings are updated accordingly."]
13222 #[doc = " This advice is recommended in scenarios where data locality is not important, but avoiding faults is."]
13223 #[doc = " Consider for example a system containing multiple GPUs with peer-to-peer access enabled, where the"]
13224 #[doc = " data located on one GPU is occasionally accessed by peer GPUs. In such scenarios, migrating data"]
13225 #[doc = " over to the other GPUs is not as important because the accesses are infrequent and the overhead of"]
13226 #[doc = " migration may be too high. But preventing faults can still help improve performance, and so having"]
13227 #[doc = " a mapping set up in advance is useful. Note that on CPU access of this data, the data may be migrated"]
13228 #[doc = " to host memory because the CPU typically cannot access device memory directly. Any GPU that had the"]
13229 #[doc = " ::cudaMemAdviceSetAccessedBy flag set for this data will now have its mapping updated to point to the"]
13230 #[doc = " page in host memory."]
13231 #[doc = " If ::cudaMemAdviseSetReadMostly is also set on this memory region or any subset of it, then the"]
13232 #[doc = " policies associated with that advice will override the policies of this advice. Additionally, if the"]
13233 #[doc = " preferred location of this memory region or any subset of it is also \\p device, then the policies"]
13234 #[doc = " associated with ::cudaMemAdviseSetPreferredLocation will override the policies of this advice."]
13235 #[doc = " If the memory region refers to valid system-allocated pageable memory, then \\p device must have a non-zero"]
13236 #[doc = " value for the device attribute ::cudaDevAttrPageableMemoryAccess. Additionally, if \\p device has"]
13237 #[doc = " a non-zero value for the device attribute ::cudaDevAttrPageableMemoryAccessUsesHostPageTables,"]
13238 #[doc = " then this call has no effect."]
13239 #[doc = ""]
13240 #[doc = " - ::cudaMemAdviseUnsetAccessedBy: Undoes the effect of ::cudaMemAdviseSetAccessedBy. Any mappings to"]
13241 #[doc = " the data from \\p device may be removed at any time causing accesses to result in non-fatal page faults."]
13242 #[doc = " If the memory region refers to valid system-allocated pageable memory, then \\p device must have a non-zero"]
13243 #[doc = " value for the device attribute ::cudaDevAttrPageableMemoryAccess. Additionally, if \\p device has"]
13244 #[doc = " a non-zero value for the device attribute ::cudaDevAttrPageableMemoryAccessUsesHostPageTables,"]
13245 #[doc = " then this call has no effect."]
13246 #[doc = ""]
13247 #[doc = " \\param devPtr - Pointer to memory to set the advice for"]
13248 #[doc = " \\param count - Size in bytes of the memory range"]
13249 #[doc = " \\param advice - Advice to be applied for the specified memory range"]
13250 #[doc = " \\param device - Device to apply the advice for"]
13251 #[doc = ""]
13252 #[doc = " \\return"]
13253 #[doc = " ::cudaSuccess,"]
13254 #[doc = " ::cudaErrorInvalidValue,"]
13255 #[doc = " ::cudaErrorInvalidDevice"]
13256 #[doc = " \\notefnerr"]
13257 #[doc = " \\note_async"]
13258 #[doc = " \\note_null_stream"]
13259 #[doc = " \\note_init_rt"]
13260 #[doc = " \\note_callback"]
13261 #[doc = ""]
13262 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpyPeer, ::cudaMemcpyAsync,"]
13263 #[doc = " ::cudaMemcpy3DPeerAsync, ::cudaMemPrefetchAsync,"]
13264 #[doc = " ::cuMemAdvise"]
13265 pub fn cudaMemAdvise(
13266 devPtr: *const ::libc::c_void,
13267 count: usize,
13268 advice: cudaMemoryAdvise,
13269 device: ::libc::c_int,
13270 ) -> cudaError_t;
13271}
13272extern "C" {
13273 #[doc = " \\brief Query an attribute of a given memory range"]
13274 #[doc = ""]
13275 #[doc = " Query an attribute about the memory range starting at \\p devPtr with a size of \\p count bytes. The"]
13276 #[doc = " memory range must refer to managed memory allocated via ::cudaMallocManaged or declared via"]
13277 #[doc = " __managed__ variables."]
13278 #[doc = ""]
13279 #[doc = " The \\p attribute parameter can take the following values:"]
13280 #[doc = " - ::cudaMemRangeAttributeReadMostly: If this attribute is specified, \\p data will be interpreted"]
13281 #[doc = " as a 32-bit integer, and \\p dataSize must be 4. The result returned will be 1 if all pages in the given"]
13282 #[doc = " memory range have read-duplication enabled, or 0 otherwise."]
13283 #[doc = " - ::cudaMemRangeAttributePreferredLocation: If this attribute is specified, \\p data will be"]
13284 #[doc = " interpreted as a 32-bit integer, and \\p dataSize must be 4. The result returned will be a GPU device"]
13285 #[doc = " id if all pages in the memory range have that GPU as their preferred location, or it will be cudaCpuDeviceId"]
13286 #[doc = " if all pages in the memory range have the CPU as their preferred location, or it will be cudaInvalidDeviceId"]
13287 #[doc = " if either all the pages don't have the same preferred location or some of the pages don't have a"]
13288 #[doc = " preferred location at all. Note that the actual location of the pages in the memory range at the time of"]
13289 #[doc = " the query may be different from the preferred location."]
13290 #[doc = " - ::cudaMemRangeAttributeAccessedBy: If this attribute is specified, \\p data will be interpreted"]
13291 #[doc = " as an array of 32-bit integers, and \\p dataSize must be a non-zero multiple of 4. The result returned"]
13292 #[doc = " will be a list of device ids that had ::cudaMemAdviceSetAccessedBy set for that entire memory range."]
13293 #[doc = " If any device does not have that advice set for the entire memory range, that device will not be included."]
13294 #[doc = " If \\p data is larger than the number of devices that have that advice set for that memory range,"]
13295 #[doc = " cudaInvalidDeviceId will be returned in all the extra space provided. For ex., if \\p dataSize is 12"]
13296 #[doc = " (i.e. \\p data has 3 elements) and only device 0 has the advice set, then the result returned will be"]
13297 #[doc = " { 0, cudaInvalidDeviceId, cudaInvalidDeviceId }. If \\p data is smaller than the number of devices that have"]
13298 #[doc = " that advice set, then only as many devices will be returned as can fit in the array. There is no"]
13299 #[doc = " guarantee on which specific devices will be returned, however."]
13300 #[doc = " - ::cudaMemRangeAttributeLastPrefetchLocation: If this attribute is specified, \\p data will be"]
13301 #[doc = " interpreted as a 32-bit integer, and \\p dataSize must be 4. The result returned will be the last location"]
13302 #[doc = " to which all pages in the memory range were prefetched explicitly via ::cudaMemPrefetchAsync. This will either be"]
13303 #[doc = " a GPU id or cudaCpuDeviceId depending on whether the last location for prefetch was a GPU or the CPU"]
13304 #[doc = " respectively. If any page in the memory range was never explicitly prefetched or if all pages were not"]
13305 #[doc = " prefetched to the same location, cudaInvalidDeviceId will be returned. Note that this simply returns the"]
13306 #[doc = " last location that the applicaton requested to prefetch the memory range to. It gives no indication as to"]
13307 #[doc = " whether the prefetch operation to that location has completed or even begun."]
13308 #[doc = ""]
13309 #[doc = " \\param data - A pointers to a memory location where the result"]
13310 #[doc = " of each attribute query will be written to."]
13311 #[doc = " \\param dataSize - Array containing the size of data"]
13312 #[doc = " \\param attribute - The attribute to query"]
13313 #[doc = " \\param devPtr - Start of the range to query"]
13314 #[doc = " \\param count - Size of the range to query"]
13315 #[doc = ""]
13316 #[doc = " \\return"]
13317 #[doc = " ::cudaSuccess,"]
13318 #[doc = " ::cudaErrorInvalidValue"]
13319 #[doc = " \\notefnerr"]
13320 #[doc = " \\note_async"]
13321 #[doc = " \\note_null_stream"]
13322 #[doc = " \\note_init_rt"]
13323 #[doc = " \\note_callback"]
13324 #[doc = ""]
13325 #[doc = " \\sa ::cudaMemRangeGetAttributes, ::cudaMemPrefetchAsync,"]
13326 #[doc = " ::cudaMemAdvise,"]
13327 #[doc = " ::cuMemRangeGetAttribute"]
13328 pub fn cudaMemRangeGetAttribute(
13329 data: *mut ::libc::c_void,
13330 dataSize: usize,
13331 attribute: cudaMemRangeAttribute,
13332 devPtr: *const ::libc::c_void,
13333 count: usize,
13334 ) -> cudaError_t;
13335}
13336extern "C" {
13337 #[doc = " \\brief Query attributes of a given memory range."]
13338 #[doc = ""]
13339 #[doc = " Query attributes of the memory range starting at \\p devPtr with a size of \\p count bytes. The"]
13340 #[doc = " memory range must refer to managed memory allocated via ::cudaMallocManaged or declared via"]
13341 #[doc = " __managed__ variables. The \\p attributes array will be interpreted to have \\p numAttributes"]
13342 #[doc = " entries. The \\p dataSizes array will also be interpreted to have \\p numAttributes entries."]
13343 #[doc = " The results of the query will be stored in \\p data."]
13344 #[doc = ""]
13345 #[doc = " The list of supported attributes are given below. Please refer to ::cudaMemRangeGetAttribute for"]
13346 #[doc = " attribute descriptions and restrictions."]
13347 #[doc = ""]
13348 #[doc = " - ::cudaMemRangeAttributeReadMostly"]
13349 #[doc = " - ::cudaMemRangeAttributePreferredLocation"]
13350 #[doc = " - ::cudaMemRangeAttributeAccessedBy"]
13351 #[doc = " - ::cudaMemRangeAttributeLastPrefetchLocation"]
13352 #[doc = ""]
13353 #[doc = " \\param data - A two-dimensional array containing pointers to memory"]
13354 #[doc = " locations where the result of each attribute query will be written to."]
13355 #[doc = " \\param dataSizes - Array containing the sizes of each result"]
13356 #[doc = " \\param attributes - An array of attributes to query"]
13357 #[doc = " (numAttributes and the number of attributes in this array should match)"]
13358 #[doc = " \\param numAttributes - Number of attributes to query"]
13359 #[doc = " \\param devPtr - Start of the range to query"]
13360 #[doc = " \\param count - Size of the range to query"]
13361 #[doc = ""]
13362 #[doc = " \\return"]
13363 #[doc = " ::cudaSuccess,"]
13364 #[doc = " ::cudaErrorInvalidValue"]
13365 #[doc = " \\notefnerr"]
13366 #[doc = " \\note_init_rt"]
13367 #[doc = " \\note_callback"]
13368 #[doc = ""]
13369 #[doc = " \\sa ::cudaMemRangeGetAttribute, ::cudaMemAdvise,"]
13370 #[doc = " ::cudaMemPrefetchAsync,"]
13371 #[doc = " ::cuMemRangeGetAttributes"]
13372 pub fn cudaMemRangeGetAttributes(
13373 data: *mut *mut ::libc::c_void,
13374 dataSizes: *mut usize,
13375 attributes: *mut cudaMemRangeAttribute,
13376 numAttributes: usize,
13377 devPtr: *const ::libc::c_void,
13378 count: usize,
13379 ) -> cudaError_t;
13380}
13381extern "C" {
13382 #[doc = " \\brief Copies data between host and device"]
13383 #[doc = ""]
13384 #[doc = " \\deprecated"]
13385 #[doc = ""]
13386 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src to the"]
13387 #[doc = " CUDA array \\p dst starting at \\p hOffset rows and \\p wOffset bytes from"]
13388 #[doc = " the upper left corner, where \\p kind specifies the direction"]
13389 #[doc = " of the copy, and must be one of ::cudaMemcpyHostToHost,"]
13390 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
13391 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
13392 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
13393 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
13394 #[doc = " allowed on systems that support unified virtual addressing."]
13395 #[doc = ""]
13396 #[doc = " \\param dst - Destination memory address"]
13397 #[doc = " \\param wOffset - Destination starting X offset (columns in bytes)"]
13398 #[doc = " \\param hOffset - Destination starting Y offset (rows)"]
13399 #[doc = " \\param src - Source memory address"]
13400 #[doc = " \\param count - Size in bytes to copy"]
13401 #[doc = " \\param kind - Type of transfer"]
13402 #[doc = ""]
13403 #[doc = " \\return"]
13404 #[doc = " ::cudaSuccess,"]
13405 #[doc = " ::cudaErrorInvalidValue,"]
13406 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
13407 #[doc = " \\notefnerr"]
13408 #[doc = " \\note_sync"]
13409 #[doc = " \\note_init_rt"]
13410 #[doc = " \\note_callback"]
13411 #[doc = ""]
13412 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D,"]
13413 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpyFromArray, ::cudaMemcpy2DFromArray,"]
13414 #[doc = " ::cudaMemcpyArrayToArray, ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
13415 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
13416 #[doc = " ::cudaMemcpyToArrayAsync, ::cudaMemcpy2DToArrayAsync,"]
13417 #[doc = " ::cudaMemcpyFromArrayAsync, ::cudaMemcpy2DFromArrayAsync,"]
13418 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
13419 #[doc = " ::cuMemcpyHtoA,"]
13420 #[doc = " ::cuMemcpyDtoA"]
13421 pub fn cudaMemcpyToArray(
13422 dst: cudaArray_t,
13423 wOffset: usize,
13424 hOffset: usize,
13425 src: *const ::libc::c_void,
13426 count: usize,
13427 kind: cudaMemcpyKind,
13428 ) -> cudaError_t;
13429}
13430extern "C" {
13431 #[doc = " \\brief Copies data between host and device"]
13432 #[doc = ""]
13433 #[doc = " \\deprecated"]
13434 #[doc = ""]
13435 #[doc = " Copies \\p count bytes from the CUDA array \\p src starting at \\p hOffset rows"]
13436 #[doc = " and \\p wOffset bytes from the upper left corner to the memory area pointed to"]
13437 #[doc = " by \\p dst, where \\p kind specifies the direction of the copy, and must be one of"]
13438 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
13439 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
13440 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
13441 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
13442 #[doc = " allowed on systems that support unified virtual addressing."]
13443 #[doc = ""]
13444 #[doc = " \\param dst - Destination memory address"]
13445 #[doc = " \\param src - Source memory address"]
13446 #[doc = " \\param wOffset - Source starting X offset (columns in bytes)"]
13447 #[doc = " \\param hOffset - Source starting Y offset (rows)"]
13448 #[doc = " \\param count - Size in bytes to copy"]
13449 #[doc = " \\param kind - Type of transfer"]
13450 #[doc = ""]
13451 #[doc = " \\return"]
13452 #[doc = " ::cudaSuccess,"]
13453 #[doc = " ::cudaErrorInvalidValue,"]
13454 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
13455 #[doc = " \\notefnerr"]
13456 #[doc = " \\note_sync"]
13457 #[doc = " \\note_init_rt"]
13458 #[doc = " \\note_callback"]
13459 #[doc = ""]
13460 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D, ::cudaMemcpyToArray,"]
13461 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpy2DFromArray,"]
13462 #[doc = " ::cudaMemcpyArrayToArray, ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
13463 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
13464 #[doc = " ::cudaMemcpyToArrayAsync, ::cudaMemcpy2DToArrayAsync,"]
13465 #[doc = " ::cudaMemcpyFromArrayAsync, ::cudaMemcpy2DFromArrayAsync,"]
13466 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
13467 #[doc = " ::cuMemcpyAtoH,"]
13468 #[doc = " ::cuMemcpyAtoD"]
13469 pub fn cudaMemcpyFromArray(
13470 dst: *mut ::libc::c_void,
13471 src: cudaArray_const_t,
13472 wOffset: usize,
13473 hOffset: usize,
13474 count: usize,
13475 kind: cudaMemcpyKind,
13476 ) -> cudaError_t;
13477}
13478extern "C" {
13479 #[doc = " \\brief Copies data between host and device"]
13480 #[doc = ""]
13481 #[doc = " \\deprecated"]
13482 #[doc = ""]
13483 #[doc = " Copies \\p count bytes from the CUDA array \\p src starting at \\p hOffsetSrc"]
13484 #[doc = " rows and \\p wOffsetSrc bytes from the upper left corner to the CUDA array"]
13485 #[doc = " \\p dst starting at \\p hOffsetDst rows and \\p wOffsetDst bytes from the upper"]
13486 #[doc = " left corner, where \\p kind specifies the direction of the copy, and must be one of"]
13487 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
13488 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
13489 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
13490 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
13491 #[doc = " allowed on systems that support unified virtual addressing."]
13492 #[doc = ""]
13493 #[doc = " \\param dst - Destination memory address"]
13494 #[doc = " \\param wOffsetDst - Destination starting X offset (columns in bytes)"]
13495 #[doc = " \\param hOffsetDst - Destination starting Y offset (rows)"]
13496 #[doc = " \\param src - Source memory address"]
13497 #[doc = " \\param wOffsetSrc - Source starting X offset (columns in bytes)"]
13498 #[doc = " \\param hOffsetSrc - Source starting Y offset (rows)"]
13499 #[doc = " \\param count - Size in bytes to copy"]
13500 #[doc = " \\param kind - Type of transfer"]
13501 #[doc = ""]
13502 #[doc = " \\return"]
13503 #[doc = " ::cudaSuccess,"]
13504 #[doc = " ::cudaErrorInvalidValue,"]
13505 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
13506 #[doc = " \\notefnerr"]
13507 #[doc = " \\note_init_rt"]
13508 #[doc = " \\note_callback"]
13509 #[doc = ""]
13510 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D, ::cudaMemcpyToArray,"]
13511 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpyFromArray, ::cudaMemcpy2DFromArray,"]
13512 #[doc = " ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
13513 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
13514 #[doc = " ::cudaMemcpyToArrayAsync, ::cudaMemcpy2DToArrayAsync,"]
13515 #[doc = " ::cudaMemcpyFromArrayAsync, ::cudaMemcpy2DFromArrayAsync,"]
13516 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
13517 #[doc = " ::cuMemcpyAtoA"]
13518 pub fn cudaMemcpyArrayToArray(
13519 dst: cudaArray_t,
13520 wOffsetDst: usize,
13521 hOffsetDst: usize,
13522 src: cudaArray_const_t,
13523 wOffsetSrc: usize,
13524 hOffsetSrc: usize,
13525 count: usize,
13526 kind: cudaMemcpyKind,
13527 ) -> cudaError_t;
13528}
13529extern "C" {
13530 #[doc = " \\brief Copies data between host and device"]
13531 #[doc = ""]
13532 #[doc = " \\deprecated"]
13533 #[doc = ""]
13534 #[doc = " Copies \\p count bytes from the memory area pointed to by \\p src to the"]
13535 #[doc = " CUDA array \\p dst starting at \\p hOffset rows and \\p wOffset bytes from"]
13536 #[doc = " the upper left corner, where \\p kind specifies the"]
13537 #[doc = " direction of the copy, and must be one of ::cudaMemcpyHostToHost,"]
13538 #[doc = " ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
13539 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
13540 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
13541 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
13542 #[doc = " allowed on systems that support unified virtual addressing."]
13543 #[doc = ""]
13544 #[doc = " ::cudaMemcpyToArrayAsync() is asynchronous with respect to the host, so"]
13545 #[doc = " the call may return before the copy is complete. The copy can optionally"]
13546 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If \\p"]
13547 #[doc = " kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and \\p stream"]
13548 #[doc = " is non-zero, the copy may overlap with operations in other streams."]
13549 #[doc = ""]
13550 #[doc = " \\param dst - Destination memory address"]
13551 #[doc = " \\param wOffset - Destination starting X offset (columns in bytes)"]
13552 #[doc = " \\param hOffset - Destination starting Y offset (rows)"]
13553 #[doc = " \\param src - Source memory address"]
13554 #[doc = " \\param count - Size in bytes to copy"]
13555 #[doc = " \\param kind - Type of transfer"]
13556 #[doc = " \\param stream - Stream identifier"]
13557 #[doc = ""]
13558 #[doc = " \\return"]
13559 #[doc = " ::cudaSuccess,"]
13560 #[doc = " ::cudaErrorInvalidValue,"]
13561 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
13562 #[doc = " \\notefnerr"]
13563 #[doc = " \\note_async"]
13564 #[doc = " \\note_null_stream"]
13565 #[doc = " \\note_init_rt"]
13566 #[doc = " \\note_callback"]
13567 #[doc = ""]
13568 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D, ::cudaMemcpyToArray,"]
13569 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpyFromArray, ::cudaMemcpy2DFromArray,"]
13570 #[doc = " ::cudaMemcpyArrayToArray, ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
13571 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
13572 #[doc = " ::cudaMemcpy2DToArrayAsync,"]
13573 #[doc = " ::cudaMemcpyFromArrayAsync, ::cudaMemcpy2DFromArrayAsync,"]
13574 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
13575 #[doc = " ::cuMemcpyHtoAAsync,"]
13576 #[doc = " ::cuMemcpy2DAsync"]
13577 pub fn cudaMemcpyToArrayAsync(
13578 dst: cudaArray_t,
13579 wOffset: usize,
13580 hOffset: usize,
13581 src: *const ::libc::c_void,
13582 count: usize,
13583 kind: cudaMemcpyKind,
13584 stream: cudaStream_t,
13585 ) -> cudaError_t;
13586}
13587extern "C" {
13588 #[doc = " \\brief Copies data between host and device"]
13589 #[doc = ""]
13590 #[doc = " \\deprecated"]
13591 #[doc = ""]
13592 #[doc = " Copies \\p count bytes from the CUDA array \\p src starting at \\p hOffset rows"]
13593 #[doc = " and \\p wOffset bytes from the upper left corner to the memory area pointed to"]
13594 #[doc = " by \\p dst, where \\p kind specifies the direction of the copy, and must be one of"]
13595 #[doc = " ::cudaMemcpyHostToHost, ::cudaMemcpyHostToDevice, ::cudaMemcpyDeviceToHost,"]
13596 #[doc = " ::cudaMemcpyDeviceToDevice, or ::cudaMemcpyDefault. Passing"]
13597 #[doc = " ::cudaMemcpyDefault is recommended, in which case the type of transfer is"]
13598 #[doc = " inferred from the pointer values. However, ::cudaMemcpyDefault is only"]
13599 #[doc = " allowed on systems that support unified virtual addressing."]
13600 #[doc = ""]
13601 #[doc = " ::cudaMemcpyFromArrayAsync() is asynchronous with respect to the host, so"]
13602 #[doc = " the call may return before the copy is complete. The copy can optionally"]
13603 #[doc = " be associated to a stream by passing a non-zero \\p stream argument. If \\p"]
13604 #[doc = " kind is ::cudaMemcpyHostToDevice or ::cudaMemcpyDeviceToHost and \\p stream"]
13605 #[doc = " is non-zero, the copy may overlap with operations in other streams."]
13606 #[doc = ""]
13607 #[doc = " \\param dst - Destination memory address"]
13608 #[doc = " \\param src - Source memory address"]
13609 #[doc = " \\param wOffset - Source starting X offset (columns in bytes)"]
13610 #[doc = " \\param hOffset - Source starting Y offset (rows)"]
13611 #[doc = " \\param count - Size in bytes to copy"]
13612 #[doc = " \\param kind - Type of transfer"]
13613 #[doc = " \\param stream - Stream identifier"]
13614 #[doc = ""]
13615 #[doc = " \\return"]
13616 #[doc = " ::cudaSuccess,"]
13617 #[doc = " ::cudaErrorInvalidValue,"]
13618 #[doc = " ::cudaErrorInvalidMemcpyDirection"]
13619 #[doc = " \\notefnerr"]
13620 #[doc = " \\note_async"]
13621 #[doc = " \\note_null_stream"]
13622 #[doc = " \\note_init_rt"]
13623 #[doc = " \\note_callback"]
13624 #[doc = ""]
13625 #[doc = " \\sa ::cudaMemcpy, ::cudaMemcpy2D, ::cudaMemcpyToArray,"]
13626 #[doc = " ::cudaMemcpy2DToArray, ::cudaMemcpyFromArray, ::cudaMemcpy2DFromArray,"]
13627 #[doc = " ::cudaMemcpyArrayToArray, ::cudaMemcpy2DArrayToArray, ::cudaMemcpyToSymbol,"]
13628 #[doc = " ::cudaMemcpyFromSymbol, ::cudaMemcpyAsync, ::cudaMemcpy2DAsync,"]
13629 #[doc = " ::cudaMemcpyToArrayAsync, ::cudaMemcpy2DToArrayAsync,"]
13630 #[doc = " ::cudaMemcpy2DFromArrayAsync,"]
13631 #[doc = " ::cudaMemcpyToSymbolAsync, ::cudaMemcpyFromSymbolAsync,"]
13632 #[doc = " ::cuMemcpyAtoHAsync,"]
13633 #[doc = " ::cuMemcpy2DAsync"]
13634 pub fn cudaMemcpyFromArrayAsync(
13635 dst: *mut ::libc::c_void,
13636 src: cudaArray_const_t,
13637 wOffset: usize,
13638 hOffset: usize,
13639 count: usize,
13640 kind: cudaMemcpyKind,
13641 stream: cudaStream_t,
13642 ) -> cudaError_t;
13643}
13644extern "C" {
13645 #[doc = " \\brief Allocates memory with stream ordered semantics"]
13646 #[doc = ""]
13647 #[doc = " Inserts an allocation operation into \\p hStream."]
13648 #[doc = " A pointer to the allocated memory is returned immediately in *dptr."]
13649 #[doc = " The allocation must not be accessed until the the allocation operation completes."]
13650 #[doc = " The allocation comes from the memory pool associated with the stream's device."]
13651 #[doc = ""]
13652 #[doc = " \\note The default memory pool of a device contains device memory from that device."]
13653 #[doc = " \\note Basic stream ordering allows future work submitted into the same stream to use the allocation."]
13654 #[doc = " Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation"]
13655 #[doc = " operation completes before work submitted in a separate stream runs."]
13656 #[doc = " \\note During stream capture, this function results in the creation of an allocation node. In this case,"]
13657 #[doc = " the allocation is owned by the graph instead of the memory pool. The memory pool's properties"]
13658 #[doc = " are used to set the node's creation parameters."]
13659 #[doc = ""]
13660 #[doc = " \\param[out] devPtr - Returned device pointer"]
13661 #[doc = " \\param[in] size - Number of bytes to allocate"]
13662 #[doc = " \\param[in] hStream - The stream establishing the stream ordering contract and the memory pool to allocate from"]
13663 #[doc = ""]
13664 #[doc = " \\return"]
13665 #[doc = " ::cudaSuccess,"]
13666 #[doc = " ::cudaErrorInvalidValue,"]
13667 #[doc = " ::cudaErrorNotSupported,"]
13668 #[doc = " ::cudaErrorOutOfMemory,"]
13669 #[doc = " \\notefnerr"]
13670 #[doc = " \\note_null_stream"]
13671 #[doc = " \\note_init_rt"]
13672 #[doc = " \\note_callback"]
13673 #[doc = ""]
13674 #[doc = " \\sa ::cuMemAllocAsync,"]
13675 #[doc = " \\ref ::cudaMallocAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) \"cudaMallocAsync (C++ API)\","]
13676 #[doc = " ::cudaMallocFromPoolAsync, ::cudaFreeAsync, ::cudaDeviceSetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolSetAccess, ::cudaMemPoolSetAttribute, ::cudaMemPoolGetAttribute"]
13677 pub fn cudaMallocAsync(
13678 devPtr: *mut *mut ::libc::c_void,
13679 size: usize,
13680 hStream: cudaStream_t,
13681 ) -> cudaError_t;
13682}
13683extern "C" {
13684 #[doc = " \\brief Frees memory with stream ordered semantics"]
13685 #[doc = ""]
13686 #[doc = " Inserts a free operation into \\p hStream."]
13687 #[doc = " The allocation must not be accessed after stream execution reaches the free."]
13688 #[doc = " After this API returns, accessing the memory from any subsequent work launched on the GPU"]
13689 #[doc = " or querying its pointer attributes results in undefined behavior."]
13690 #[doc = ""]
13691 #[doc = " \\note During stream capture, this function results in the creation of a free node and"]
13692 #[doc = " must therefore be passed the address of a graph allocation."]
13693 #[doc = ""]
13694 #[doc = " \\param dptr - memory to free"]
13695 #[doc = " \\param hStream - The stream establishing the stream ordering promise"]
13696 #[doc = " \\returns"]
13697 #[doc = " ::cudaSuccess,"]
13698 #[doc = " ::cudaErrorInvalidValue,"]
13699 #[doc = " ::cudaErrorNotSupported"]
13700 #[doc = " \\notefnerr"]
13701 #[doc = " \\note_null_stream"]
13702 #[doc = " \\note_init_rt"]
13703 #[doc = " \\note_callback"]
13704 #[doc = ""]
13705 #[doc = " \\sa ::cuMemFreeAsync, ::cudaMallocAsync"]
13706 pub fn cudaFreeAsync(devPtr: *mut ::libc::c_void, hStream: cudaStream_t) -> cudaError_t;
13707}
13708extern "C" {
13709 #[doc = " \\brief Tries to release memory back to the OS"]
13710 #[doc = ""]
13711 #[doc = " Releases memory back to the OS until the pool contains fewer than minBytesToKeep"]
13712 #[doc = " reserved bytes, or there is no more memory that the allocator can safely release."]
13713 #[doc = " The allocator cannot release OS allocations that back outstanding asynchronous allocations."]
13714 #[doc = " The OS allocations may happen at different granularity from the user allocations."]
13715 #[doc = ""]
13716 #[doc = " \\note: Allocations that have not been freed count as outstanding."]
13717 #[doc = " \\note: Allocations that have been asynchronously freed but whose completion has"]
13718 #[doc = " not been observed on the host (eg. by a synchronize) can count as outstanding."]
13719 #[doc = ""]
13720 #[doc = " \\param[in] pool - The memory pool to trim"]
13721 #[doc = " \\param[in] minBytesToKeep - If the pool has less than minBytesToKeep reserved,"]
13722 #[doc = " the TrimTo operation is a no-op. Otherwise the pool will be guaranteed to have"]
13723 #[doc = " at least minBytesToKeep bytes reserved after the operation."]
13724 #[doc = " \\returns"]
13725 #[doc = " ::cudaSuccess,"]
13726 #[doc = " ::cudaErrorInvalidValue"]
13727 #[doc = " \\note_callback"]
13728 #[doc = ""]
13729 #[doc = " \\sa ::cuMemPoolTrimTo, ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate"]
13730 pub fn cudaMemPoolTrimTo(memPool: cudaMemPool_t, minBytesToKeep: usize) -> cudaError_t;
13731}
13732extern "C" {
13733 #[doc = " \\brief Sets attributes of a memory pool"]
13734 #[doc = ""]
13735 #[doc = " Supported attributes are:"]
13736 #[doc = " - ::cudaMemPoolAttrReleaseThreshold: (value type = cuuint64_t)"]
13737 #[doc = " Amount of reserved memory in bytes to hold onto before trying"]
13738 #[doc = " to release memory back to the OS. When more than the release"]
13739 #[doc = " threshold bytes of memory are held by the memory pool, the"]
13740 #[doc = " allocator will try to release memory back to the OS on the"]
13741 #[doc = " next call to stream, event or context synchronize. (default 0)"]
13742 #[doc = " - ::cudaMemPoolReuseFollowEventDependencies: (value type = int)"]
13743 #[doc = " Allow ::cudaMallocAsync to use memory asynchronously freed"]
13744 #[doc = " in another stream as long as a stream ordering dependency"]
13745 #[doc = " of the allocating stream on the free action exists."]
13746 #[doc = " Cuda events and null stream interactions can create the required"]
13747 #[doc = " stream ordered dependencies. (default enabled)"]
13748 #[doc = " - ::cudaMemPoolReuseAllowOpportunistic: (value type = int)"]
13749 #[doc = " Allow reuse of already completed frees when there is no dependency"]
13750 #[doc = " between the free and allocation. (default enabled)"]
13751 #[doc = " - ::cudaMemPoolReuseAllowInternalDependencies: (value type = int)"]
13752 #[doc = " Allow ::cudaMallocAsync to insert new stream dependencies"]
13753 #[doc = " in order to establish the stream ordering required to reuse"]
13754 #[doc = " a piece of memory released by ::cudaFreeAsync (default enabled)."]
13755 #[doc = ""]
13756 #[doc = " \\param[in] pool - The memory pool to modify"]
13757 #[doc = " \\param[in] attr - The attribute to modify"]
13758 #[doc = " \\param[in] value - Pointer to the value to assign"]
13759 #[doc = ""]
13760 #[doc = " \\returns"]
13761 #[doc = " ::cudaSuccess,"]
13762 #[doc = " ::cudaErrorInvalidValue"]
13763 #[doc = " \\note_callback"]
13764 #[doc = ""]
13765 #[doc = " \\sa ::cuMemPoolSetAttribute, ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate"]
13766 #[doc = ""]
13767 pub fn cudaMemPoolSetAttribute(
13768 memPool: cudaMemPool_t,
13769 attr: cudaMemPoolAttr,
13770 value: *mut ::libc::c_void,
13771 ) -> cudaError_t;
13772}
13773extern "C" {
13774 #[doc = " \\brief Gets attributes of a memory pool"]
13775 #[doc = ""]
13776 #[doc = " Supported attributes are:"]
13777 #[doc = " - ::cudaMemPoolAttrReleaseThreshold: (value type = cuuint64_t)"]
13778 #[doc = " Amount of reserved memory in bytes to hold onto before trying"]
13779 #[doc = " to release memory back to the OS. When more than the release"]
13780 #[doc = " threshold bytes of memory are held by the memory pool, the"]
13781 #[doc = " allocator will try to release memory back to the OS on the"]
13782 #[doc = " next call to stream, event or context synchronize. (default 0)"]
13783 #[doc = " - ::cudaMemPoolReuseFollowEventDependencies: (value type = int)"]
13784 #[doc = " Allow ::cudaMallocAsync to use memory asynchronously freed"]
13785 #[doc = " in another stream as long as a stream ordering dependency"]
13786 #[doc = " of the allocating stream on the free action exists."]
13787 #[doc = " Cuda events and null stream interactions can create the required"]
13788 #[doc = " stream ordered dependencies. (default enabled)"]
13789 #[doc = " - ::cudaMemPoolReuseAllowOpportunistic: (value type = int)"]
13790 #[doc = " Allow reuse of already completed frees when there is no dependency"]
13791 #[doc = " between the free and allocation. (default enabled)"]
13792 #[doc = " - ::cudaMemPoolReuseAllowInternalDependencies: (value type = int)"]
13793 #[doc = " Allow ::cudaMallocAsync to insert new stream dependencies"]
13794 #[doc = " in order to establish the stream ordering required to reuse"]
13795 #[doc = " a piece of memory released by ::cudaFreeAsync (default enabled)."]
13796 #[doc = ""]
13797 #[doc = " \\param[in] pool - The memory pool to get attributes of"]
13798 #[doc = " \\param[in] attr - The attribute to get"]
13799 #[doc = " \\param[in] value - Retrieved value"]
13800 #[doc = ""]
13801 #[doc = " \\returns"]
13802 #[doc = " ::cudaSuccess,"]
13803 #[doc = " ::cudaErrorInvalidValue"]
13804 #[doc = " \\note_callback"]
13805 #[doc = ""]
13806 #[doc = " \\sa ::cuMemPoolGetAttribute, ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate"]
13807 #[doc = ""]
13808 pub fn cudaMemPoolGetAttribute(
13809 memPool: cudaMemPool_t,
13810 attr: cudaMemPoolAttr,
13811 value: *mut ::libc::c_void,
13812 ) -> cudaError_t;
13813}
13814extern "C" {
13815 #[doc = " \\brief Controls visibility of pools between devices"]
13816 #[doc = ""]
13817 #[doc = " \\param[in] pool - The pool being modified"]
13818 #[doc = " \\param[in] map - Array of access descriptors. Each descriptor instructs the access to enable for a single gpu"]
13819 #[doc = " \\param[in] count - Number of descriptors in the map array."]
13820 #[doc = ""]
13821 #[doc = " \\returns"]
13822 #[doc = " ::cudaSuccess,"]
13823 #[doc = " ::cudaErrorInvalidValue"]
13824 #[doc = ""]
13825 #[doc = " \\sa ::cuMemPoolSetAccess, ::cudaMemPoolGetAccess, ::cudaMallocAsync, cudaFreeAsync"]
13826 pub fn cudaMemPoolSetAccess(
13827 memPool: cudaMemPool_t,
13828 descList: *const cudaMemAccessDesc,
13829 count: usize,
13830 ) -> cudaError_t;
13831}
13832extern "C" {
13833 #[doc = " \\brief Returns the accessibility of a pool from a device"]
13834 #[doc = ""]
13835 #[doc = " Returns the accessibility of the pool's memory from the specified location."]
13836 #[doc = ""]
13837 #[doc = " \\param[out] flags - the accessibility of the pool from the specified location"]
13838 #[doc = " \\param[in] memPool - the pool being queried"]
13839 #[doc = " \\param[in] location - the location accessing the pool"]
13840 #[doc = ""]
13841 #[doc = " \\sa ::cuMemPoolGetAccess, ::cudaMemPoolSetAccess"]
13842 pub fn cudaMemPoolGetAccess(
13843 flags: *mut cudaMemAccessFlags,
13844 memPool: cudaMemPool_t,
13845 location: *mut cudaMemLocation,
13846 ) -> cudaError_t;
13847}
13848extern "C" {
13849 #[doc = " \\brief Creates a memory pool"]
13850 #[doc = ""]
13851 #[doc = " Creates a CUDA memory pool and returns the handle in \\p pool. The \\p poolProps determines"]
13852 #[doc = " the properties of the pool such as the backing device and IPC capabilities."]
13853 #[doc = ""]
13854 #[doc = " By default, the pool's memory will be accessible from the device it is allocated on."]
13855 #[doc = ""]
13856 #[doc = " \\note Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC."]
13857 #[doc = ""]
13858 #[doc = " \\returns"]
13859 #[doc = " ::cudaSuccess,"]
13860 #[doc = " ::cudaErrorInvalidValue,"]
13861 #[doc = " ::cudaErrorNotSupported"]
13862 #[doc = ""]
13863 #[doc = " \\sa ::cuMemPoolCreate, ::cudaDeviceSetMemPool, ::cudaMallocFromPoolAsync, ::cudaMemPoolExportToShareableHandle, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool"]
13864 #[doc = ""]
13865 pub fn cudaMemPoolCreate(
13866 memPool: *mut cudaMemPool_t,
13867 poolProps: *const cudaMemPoolProps,
13868 ) -> cudaError_t;
13869}
13870extern "C" {
13871 #[doc = " \\brief Destroys the specified memory pool"]
13872 #[doc = ""]
13873 #[doc = " If any pointers obtained from this pool haven't been freed or"]
13874 #[doc = " the pool has free operations that haven't completed"]
13875 #[doc = " when ::cudaMemPoolDestroy is invoked, the function will return immediately and the"]
13876 #[doc = " resources associated with the pool will be released automatically"]
13877 #[doc = " once there are no more outstanding allocations."]
13878 #[doc = ""]
13879 #[doc = " Destroying the current mempool of a device sets the default mempool of"]
13880 #[doc = " that device as the current mempool for that device."]
13881 #[doc = ""]
13882 #[doc = " \\note A device's default memory pool cannot be destroyed."]
13883 #[doc = ""]
13884 #[doc = " \\returns"]
13885 #[doc = " ::cudaSuccess,"]
13886 #[doc = " ::cudaErrorInvalidValue"]
13887 #[doc = ""]
13888 #[doc = " \\sa cuMemPoolDestroy, ::cudaFreeAsync, ::cudaDeviceSetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate"]
13889 pub fn cudaMemPoolDestroy(memPool: cudaMemPool_t) -> cudaError_t;
13890}
13891extern "C" {
13892 #[doc = " \\brief Allocates memory from a specified pool with stream ordered semantics."]
13893 #[doc = ""]
13894 #[doc = " Inserts an allocation operation into \\p hStream."]
13895 #[doc = " A pointer to the allocated memory is returned immediately in *dptr."]
13896 #[doc = " The allocation must not be accessed until the the allocation operation completes."]
13897 #[doc = " The allocation comes from the specified memory pool."]
13898 #[doc = ""]
13899 #[doc = " \\note"]
13900 #[doc = " - The specified memory pool may be from a device different than that of the specified \\p hStream."]
13901 #[doc = ""]
13902 #[doc = " - Basic stream ordering allows future work submitted into the same stream to use the allocation."]
13903 #[doc = " Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation"]
13904 #[doc = " operation completes before work submitted in a separate stream runs."]
13905 #[doc = ""]
13906 #[doc = " \\note During stream capture, this function results in the creation of an allocation node. In this case,"]
13907 #[doc = " the allocation is owned by the graph instead of the memory pool. The memory pool's properties"]
13908 #[doc = " are used to set the node's creation parameters."]
13909 #[doc = ""]
13910 #[doc = " \\param[out] ptr - Returned device pointer"]
13911 #[doc = " \\param[in] bytesize - Number of bytes to allocate"]
13912 #[doc = " \\param[in] memPool - The pool to allocate from"]
13913 #[doc = " \\param[in] stream - The stream establishing the stream ordering semantic"]
13914 #[doc = ""]
13915 #[doc = " \\returns"]
13916 #[doc = " ::cudaSuccess,"]
13917 #[doc = " ::cudaErrorInvalidValue,"]
13918 #[doc = " ::cudaErrorNotSupported,"]
13919 #[doc = " ::cudaErrorOutOfMemory"]
13920 #[doc = ""]
13921 #[doc = " \\sa ::cuMemAllocFromPoolAsync,"]
13922 #[doc = " \\ref ::cudaMallocAsync(void** ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) \"cudaMallocAsync (C++ API)\","]
13923 #[doc = " ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaMemPoolCreate, ::cudaMemPoolSetAccess, ::cudaMemPoolSetAttribute"]
13924 pub fn cudaMallocFromPoolAsync(
13925 ptr: *mut *mut ::libc::c_void,
13926 size: usize,
13927 memPool: cudaMemPool_t,
13928 stream: cudaStream_t,
13929 ) -> cudaError_t;
13930}
13931extern "C" {
13932 #[doc = " \\brief Exports a memory pool to the requested handle type."]
13933 #[doc = ""]
13934 #[doc = " Given an IPC capable mempool, create an OS handle to share the pool with another process."]
13935 #[doc = " A recipient process can convert the shareable handle into a mempool with ::cudaMemPoolImportFromShareableHandle."]
13936 #[doc = " Individual pointers can then be shared with the ::cudaMemPoolExportPointer and ::cudaMemPoolImportPointer APIs."]
13937 #[doc = " The implementation of what the shareable handle is and how it can be transferred is defined by the requested"]
13938 #[doc = " handle type."]
13939 #[doc = ""]
13940 #[doc = " \\note: To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than cudaMemHandleTypeNone."]
13941 #[doc = ""]
13942 #[doc = " \\param[out] handle_out - pointer to the location in which to store the requested handle"]
13943 #[doc = " \\param[in] pool - pool to export"]
13944 #[doc = " \\param[in] handleType - the type of handle to create"]
13945 #[doc = " \\param[in] flags - must be 0"]
13946 #[doc = ""]
13947 #[doc = " \\returns"]
13948 #[doc = " ::cudaSuccess,"]
13949 #[doc = " ::cudaErrorInvalidValue,"]
13950 #[doc = " ::cudaErrorOutOfMemory"]
13951 #[doc = ""]
13952 #[doc = " \\sa ::cuMemPoolExportToShareableHandle, ::cudaMemPoolImportFromShareableHandle, ::cudaMemPoolExportPointer, ::cudaMemPoolImportPointer"]
13953 pub fn cudaMemPoolExportToShareableHandle(
13954 shareableHandle: *mut ::libc::c_void,
13955 memPool: cudaMemPool_t,
13956 handleType: cudaMemAllocationHandleType,
13957 flags: ::libc::c_uint,
13958 ) -> cudaError_t;
13959}
13960extern "C" {
13961 #[doc = " \\brief imports a memory pool from a shared handle."]
13962 #[doc = ""]
13963 #[doc = " Specific allocations can be imported from the imported pool with ::cudaMemPoolImportPointer."]
13964 #[doc = ""]
13965 #[doc = " \\note Imported memory pools do not support creating new allocations."]
13966 #[doc = " As such imported memory pools may not be used in ::cudaDeviceSetMemPool"]
13967 #[doc = " or ::cudaMallocFromPoolAsync calls."]
13968 #[doc = ""]
13969 #[doc = " \\param[out] pool_out - Returned memory pool"]
13970 #[doc = " \\param[in] handle - OS handle of the pool to open"]
13971 #[doc = " \\param[in] handleType - The type of handle being imported"]
13972 #[doc = " \\param[in] flags - must be 0"]
13973 #[doc = ""]
13974 #[doc = " \\returns"]
13975 #[doc = " ::cudaSuccess,"]
13976 #[doc = " ::cudaErrorInvalidValue,"]
13977 #[doc = " ::cudaErrorOutOfMemory"]
13978 #[doc = ""]
13979 #[doc = " \\sa ::cuMemPoolImportFromShareableHandle, ::cudaMemPoolExportToShareableHandle, ::cudaMemPoolExportPointer, ::cudaMemPoolImportPointer"]
13980 pub fn cudaMemPoolImportFromShareableHandle(
13981 memPool: *mut cudaMemPool_t,
13982 shareableHandle: *mut ::libc::c_void,
13983 handleType: cudaMemAllocationHandleType,
13984 flags: ::libc::c_uint,
13985 ) -> cudaError_t;
13986}
13987extern "C" {
13988 #[doc = " \\brief Export data to share a memory pool allocation between processes."]
13989 #[doc = ""]
13990 #[doc = " Constructs \\p shareData_out for sharing a specific allocation from an already shared memory pool."]
13991 #[doc = " The recipient process can import the allocation with the ::cudaMemPoolImportPointer api."]
13992 #[doc = " The data is not a handle and may be shared through any IPC mechanism."]
13993 #[doc = ""]
13994 #[doc = " \\param[out] shareData_out - Returned export data"]
13995 #[doc = " \\param[in] ptr - pointer to memory being exported"]
13996 #[doc = ""]
13997 #[doc = " \\returns"]
13998 #[doc = " ::cudaSuccess,"]
13999 #[doc = " ::cudaErrorInvalidValue,"]
14000 #[doc = " ::cudaErrorOutOfMemory"]
14001 #[doc = ""]
14002 #[doc = " \\sa ::cuMemPoolExportPointer, ::cudaMemPoolExportToShareableHandle, ::cudaMemPoolImportFromShareableHandle, ::cudaMemPoolImportPointer"]
14003 pub fn cudaMemPoolExportPointer(
14004 exportData: *mut cudaMemPoolPtrExportData,
14005 ptr: *mut ::libc::c_void,
14006 ) -> cudaError_t;
14007}
14008extern "C" {
14009 #[doc = " \\brief Import a memory pool allocation from another process."]
14010 #[doc = ""]
14011 #[doc = " Returns in \\p ptr_out a pointer to the imported memory."]
14012 #[doc = " The imported memory must not be accessed before the allocation operation completes"]
14013 #[doc = " in the exporting process. The imported memory must be freed from all importing processes before"]
14014 #[doc = " being freed in the exporting process. The pointer may be freed with cudaFree"]
14015 #[doc = " or cudaFreeAsync. If ::cudaFreeAsync is used, the free must be completed"]
14016 #[doc = " on the importing process before the free operation on the exporting process."]
14017 #[doc = ""]
14018 #[doc = " \\note The ::cudaFreeAsync api may be used in the exporting process before"]
14019 #[doc = " the ::cudaFreeAsync operation completes in its stream as long as the"]
14020 #[doc = " ::cudaFreeAsync in the exporting process specifies a stream with"]
14021 #[doc = " a stream dependency on the importing process's ::cudaFreeAsync."]
14022 #[doc = ""]
14023 #[doc = " \\param[out] ptr_out - pointer to imported memory"]
14024 #[doc = " \\param[in] pool - pool from which to import"]
14025 #[doc = " \\param[in] shareData - data specifying the memory to import"]
14026 #[doc = ""]
14027 #[doc = " \\returns"]
14028 #[doc = " ::CUDA_SUCCESS,"]
14029 #[doc = " ::CUDA_ERROR_INVALID_VALUE,"]
14030 #[doc = " ::CUDA_ERROR_NOT_INITIALIZED,"]
14031 #[doc = " ::CUDA_ERROR_OUT_OF_MEMORY"]
14032 #[doc = ""]
14033 #[doc = " \\sa ::cuMemPoolImportPointer, ::cudaMemPoolExportToShareableHandle, ::cudaMemPoolImportFromShareableHandle, ::cudaMemPoolExportPointer"]
14034 pub fn cudaMemPoolImportPointer(
14035 ptr: *mut *mut ::libc::c_void,
14036 memPool: cudaMemPool_t,
14037 exportData: *mut cudaMemPoolPtrExportData,
14038 ) -> cudaError_t;
14039}
14040extern "C" {
14041 #[doc = " \\brief Returns attributes about a specified pointer"]
14042 #[doc = ""]
14043 #[doc = " Returns in \\p *attributes the attributes of the pointer \\p ptr."]
14044 #[doc = " If pointer was not allocated in, mapped by or registered with context"]
14045 #[doc = " supporting unified addressing ::cudaErrorInvalidValue is returned."]
14046 #[doc = ""]
14047 #[doc = " \\note In CUDA 11.0 forward passing host pointer will return ::cudaMemoryTypeUnregistered"]
14048 #[doc = " in ::cudaPointerAttributes::type and call will return ::cudaSuccess."]
14049 #[doc = ""]
14050 #[doc = " The ::cudaPointerAttributes structure is defined as:"]
14051 #[doc = " \\code"]
14052 #[doc = "struct cudaPointerAttributes {"]
14053 #[doc = "enum cudaMemoryType type;"]
14054 #[doc = "int device;"]
14055 #[doc = "void *devicePointer;"]
14056 #[doc = "void *hostPointer;"]
14057 #[doc = "}"]
14058 #[doc = "\\endcode"]
14059 #[doc = " In this structure, the individual fields mean"]
14060 #[doc = ""]
14061 #[doc = " - \\ref ::cudaPointerAttributes::type identifies type of memory. It can be"]
14062 #[doc = " ::cudaMemoryTypeUnregistered for unregistered host memory,"]
14063 #[doc = " ::cudaMemoryTypeHost for registered host memory, ::cudaMemoryTypeDevice for device"]
14064 #[doc = " memory or ::cudaMemoryTypeManaged for managed memory."]
14065 #[doc = ""]
14066 #[doc = " - \\ref ::cudaPointerAttributes::device \"device\" is the device against which"]
14067 #[doc = " \\p ptr was allocated. If \\p ptr has memory type ::cudaMemoryTypeDevice"]
14068 #[doc = " then this identifies the device on which the memory referred to by \\p ptr"]
14069 #[doc = " physically resides. If \\p ptr has memory type ::cudaMemoryTypeHost then this"]
14070 #[doc = " identifies the device which was current when the allocation was made"]
14071 #[doc = " (and if that device is deinitialized then this allocation will vanish"]
14072 #[doc = " with that device's state)."]
14073 #[doc = ""]
14074 #[doc = " - \\ref ::cudaPointerAttributes::devicePointer \"devicePointer\" is"]
14075 #[doc = " the device pointer alias through which the memory referred to by \\p ptr"]
14076 #[doc = " may be accessed on the current device."]
14077 #[doc = " If the memory referred to by \\p ptr cannot be accessed directly by the"]
14078 #[doc = " current device then this is NULL."]
14079 #[doc = ""]
14080 #[doc = " - \\ref ::cudaPointerAttributes::hostPointer \"hostPointer\" is"]
14081 #[doc = " the host pointer alias through which the memory referred to by \\p ptr"]
14082 #[doc = " may be accessed on the host."]
14083 #[doc = " If the memory referred to by \\p ptr cannot be accessed directly by the"]
14084 #[doc = " host then this is NULL."]
14085 #[doc = ""]
14086 #[doc = " \\param attributes - Attributes for the specified pointer"]
14087 #[doc = " \\param ptr - Pointer to get attributes for"]
14088 #[doc = ""]
14089 #[doc = " \\return"]
14090 #[doc = " ::cudaSuccess,"]
14091 #[doc = " ::cudaErrorInvalidDevice,"]
14092 #[doc = " ::cudaErrorInvalidValue"]
14093 #[doc = " \\note_init_rt"]
14094 #[doc = " \\note_callback"]
14095 #[doc = ""]
14096 #[doc = " \\sa ::cudaGetDeviceCount, ::cudaGetDevice, ::cudaSetDevice,"]
14097 #[doc = " ::cudaChooseDevice,"]
14098 #[doc = " ::cuPointerGetAttributes"]
14099 pub fn cudaPointerGetAttributes(
14100 attributes: *mut cudaPointerAttributes,
14101 ptr: *const ::libc::c_void,
14102 ) -> cudaError_t;
14103}
14104extern "C" {
14105 #[doc = " \\brief Queries if a device may directly access a peer device's memory."]
14106 #[doc = ""]
14107 #[doc = " Returns in \\p *canAccessPeer a value of 1 if device \\p device is capable of"]
14108 #[doc = " directly accessing memory from \\p peerDevice and 0 otherwise. If direct"]
14109 #[doc = " access of \\p peerDevice from \\p device is possible, then access may be"]
14110 #[doc = " enabled by calling ::cudaDeviceEnablePeerAccess()."]
14111 #[doc = ""]
14112 #[doc = " \\param canAccessPeer - Returned access capability"]
14113 #[doc = " \\param device - Device from which allocations on \\p peerDevice are to"]
14114 #[doc = " be directly accessed."]
14115 #[doc = " \\param peerDevice - Device on which the allocations to be directly accessed"]
14116 #[doc = " by \\p device reside."]
14117 #[doc = ""]
14118 #[doc = " \\return"]
14119 #[doc = " ::cudaSuccess,"]
14120 #[doc = " ::cudaErrorInvalidDevice"]
14121 #[doc = " \\notefnerr"]
14122 #[doc = " \\note_init_rt"]
14123 #[doc = " \\note_callback"]
14124 #[doc = ""]
14125 #[doc = " \\sa ::cudaDeviceEnablePeerAccess,"]
14126 #[doc = " ::cudaDeviceDisablePeerAccess,"]
14127 #[doc = " ::cuDeviceCanAccessPeer"]
14128 pub fn cudaDeviceCanAccessPeer(
14129 canAccessPeer: *mut ::libc::c_int,
14130 device: ::libc::c_int,
14131 peerDevice: ::libc::c_int,
14132 ) -> cudaError_t;
14133}
14134extern "C" {
14135 #[doc = " \\brief Enables direct access to memory allocations on a peer device."]
14136 #[doc = ""]
14137 #[doc = " On success, all allocations from \\p peerDevice will immediately be accessible by"]
14138 #[doc = " the current device. They will remain accessible until access is explicitly"]
14139 #[doc = " disabled using ::cudaDeviceDisablePeerAccess() or either device is reset using"]
14140 #[doc = " ::cudaDeviceReset()."]
14141 #[doc = ""]
14142 #[doc = " Note that access granted by this call is unidirectional and that in order to access"]
14143 #[doc = " memory on the current device from \\p peerDevice, a separate symmetric call"]
14144 #[doc = " to ::cudaDeviceEnablePeerAccess() is required."]
14145 #[doc = ""]
14146 #[doc = " Note that there are both device-wide and system-wide limitations per system"]
14147 #[doc = " configuration, as noted in the CUDA Programming Guide under the section"]
14148 #[doc = " \"Peer-to-Peer Memory Access\"."]
14149 #[doc = ""]
14150 #[doc = " Returns ::cudaErrorInvalidDevice if ::cudaDeviceCanAccessPeer() indicates"]
14151 #[doc = " that the current device cannot directly access memory from \\p peerDevice."]
14152 #[doc = ""]
14153 #[doc = " Returns ::cudaErrorPeerAccessAlreadyEnabled if direct access of"]
14154 #[doc = " \\p peerDevice from the current device has already been enabled."]
14155 #[doc = ""]
14156 #[doc = " Returns ::cudaErrorInvalidValue if \\p flags is not 0."]
14157 #[doc = ""]
14158 #[doc = " \\param peerDevice - Peer device to enable direct access to from the current device"]
14159 #[doc = " \\param flags - Reserved for future use and must be set to 0"]
14160 #[doc = ""]
14161 #[doc = " \\return"]
14162 #[doc = " ::cudaSuccess,"]
14163 #[doc = " ::cudaErrorInvalidDevice,"]
14164 #[doc = " ::cudaErrorPeerAccessAlreadyEnabled,"]
14165 #[doc = " ::cudaErrorInvalidValue"]
14166 #[doc = " \\notefnerr"]
14167 #[doc = " \\note_init_rt"]
14168 #[doc = " \\note_callback"]
14169 #[doc = ""]
14170 #[doc = " \\sa ::cudaDeviceCanAccessPeer,"]
14171 #[doc = " ::cudaDeviceDisablePeerAccess,"]
14172 #[doc = " ::cuCtxEnablePeerAccess"]
14173 pub fn cudaDeviceEnablePeerAccess(
14174 peerDevice: ::libc::c_int,
14175 flags: ::libc::c_uint,
14176 ) -> cudaError_t;
14177}
14178extern "C" {
14179 #[doc = " \\brief Disables direct access to memory allocations on a peer device."]
14180 #[doc = ""]
14181 #[doc = " Returns ::cudaErrorPeerAccessNotEnabled if direct access to memory on"]
14182 #[doc = " \\p peerDevice has not yet been enabled from the current device."]
14183 #[doc = ""]
14184 #[doc = " \\param peerDevice - Peer device to disable direct access to"]
14185 #[doc = ""]
14186 #[doc = " \\return"]
14187 #[doc = " ::cudaSuccess,"]
14188 #[doc = " ::cudaErrorPeerAccessNotEnabled,"]
14189 #[doc = " ::cudaErrorInvalidDevice"]
14190 #[doc = " \\notefnerr"]
14191 #[doc = " \\note_init_rt"]
14192 #[doc = " \\note_callback"]
14193 #[doc = ""]
14194 #[doc = " \\sa ::cudaDeviceCanAccessPeer,"]
14195 #[doc = " ::cudaDeviceEnablePeerAccess,"]
14196 #[doc = " ::cuCtxDisablePeerAccess"]
14197 pub fn cudaDeviceDisablePeerAccess(peerDevice: ::libc::c_int) -> cudaError_t;
14198}
14199extern "C" {
14200 #[doc = " \\brief Unregisters a graphics resource for access by CUDA"]
14201 #[doc = ""]
14202 #[doc = " Unregisters the graphics resource \\p resource so it is not accessible by"]
14203 #[doc = " CUDA unless registered again."]
14204 #[doc = ""]
14205 #[doc = " If \\p resource is invalid then ::cudaErrorInvalidResourceHandle is"]
14206 #[doc = " returned."]
14207 #[doc = ""]
14208 #[doc = " \\param resource - Resource to unregister"]
14209 #[doc = ""]
14210 #[doc = " \\return"]
14211 #[doc = " ::cudaSuccess,"]
14212 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14213 #[doc = " ::cudaErrorUnknown"]
14214 #[doc = " \\notefnerr"]
14215 #[doc = " \\note_init_rt"]
14216 #[doc = " \\note_callback"]
14217 #[doc = " \\note_destroy_ub"]
14218 #[doc = ""]
14219 #[doc = " \\sa"]
14220 #[doc = " ::cudaGraphicsD3D9RegisterResource,"]
14221 #[doc = " ::cudaGraphicsD3D10RegisterResource,"]
14222 #[doc = " ::cudaGraphicsD3D11RegisterResource,"]
14223 #[doc = " ::cudaGraphicsGLRegisterBuffer,"]
14224 #[doc = " ::cudaGraphicsGLRegisterImage,"]
14225 #[doc = " ::cuGraphicsUnregisterResource"]
14226 pub fn cudaGraphicsUnregisterResource(resource: cudaGraphicsResource_t) -> cudaError_t;
14227}
14228extern "C" {
14229 #[doc = " \\brief Set usage flags for mapping a graphics resource"]
14230 #[doc = ""]
14231 #[doc = " Set \\p flags for mapping the graphics resource \\p resource."]
14232 #[doc = ""]
14233 #[doc = " Changes to \\p flags will take effect the next time \\p resource is mapped."]
14234 #[doc = " The \\p flags argument may be any of the following:"]
14235 #[doc = " - ::cudaGraphicsMapFlagsNone: Specifies no hints about how \\p resource will"]
14236 #[doc = " be used. It is therefore assumed that CUDA may read from or write to \\p resource."]
14237 #[doc = " - ::cudaGraphicsMapFlagsReadOnly: Specifies that CUDA will not write to \\p resource."]
14238 #[doc = " - ::cudaGraphicsMapFlagsWriteDiscard: Specifies CUDA will not read from \\p resource and will"]
14239 #[doc = " write over the entire contents of \\p resource, so none of the data"]
14240 #[doc = " previously stored in \\p resource will be preserved."]
14241 #[doc = ""]
14242 #[doc = " If \\p resource is presently mapped for access by CUDA then ::cudaErrorUnknown is returned."]
14243 #[doc = " If \\p flags is not one of the above values then ::cudaErrorInvalidValue is returned."]
14244 #[doc = ""]
14245 #[doc = " \\param resource - Registered resource to set flags for"]
14246 #[doc = " \\param flags - Parameters for resource mapping"]
14247 #[doc = ""]
14248 #[doc = " \\return"]
14249 #[doc = " ::cudaSuccess,"]
14250 #[doc = " ::cudaErrorInvalidValue,"]
14251 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14252 #[doc = " ::cudaErrorUnknown,"]
14253 #[doc = " \\notefnerr"]
14254 #[doc = " \\note_init_rt"]
14255 #[doc = " \\note_callback"]
14256 #[doc = ""]
14257 #[doc = " \\sa"]
14258 #[doc = " ::cudaGraphicsMapResources,"]
14259 #[doc = " ::cuGraphicsResourceSetMapFlags"]
14260 pub fn cudaGraphicsResourceSetMapFlags(
14261 resource: cudaGraphicsResource_t,
14262 flags: ::libc::c_uint,
14263 ) -> cudaError_t;
14264}
14265extern "C" {
14266 #[doc = " \\brief Map graphics resources for access by CUDA"]
14267 #[doc = ""]
14268 #[doc = " Maps the \\p count graphics resources in \\p resources for access by CUDA."]
14269 #[doc = ""]
14270 #[doc = " The resources in \\p resources may be accessed by CUDA until they"]
14271 #[doc = " are unmapped. The graphics API from which \\p resources were registered"]
14272 #[doc = " should not access any resources while they are mapped by CUDA. If an"]
14273 #[doc = " application does so, the results are undefined."]
14274 #[doc = ""]
14275 #[doc = " This function provides the synchronization guarantee that any graphics calls"]
14276 #[doc = " issued before ::cudaGraphicsMapResources() will complete before any subsequent CUDA"]
14277 #[doc = " work issued in \\p stream begins."]
14278 #[doc = ""]
14279 #[doc = " If \\p resources contains any duplicate entries then ::cudaErrorInvalidResourceHandle"]
14280 #[doc = " is returned. If any of \\p resources are presently mapped for access by"]
14281 #[doc = " CUDA then ::cudaErrorUnknown is returned."]
14282 #[doc = ""]
14283 #[doc = " \\param count - Number of resources to map"]
14284 #[doc = " \\param resources - Resources to map for CUDA"]
14285 #[doc = " \\param stream - Stream for synchronization"]
14286 #[doc = ""]
14287 #[doc = " \\return"]
14288 #[doc = " ::cudaSuccess,"]
14289 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14290 #[doc = " ::cudaErrorUnknown"]
14291 #[doc = " \\note_null_stream"]
14292 #[doc = " \\notefnerr"]
14293 #[doc = " \\note_init_rt"]
14294 #[doc = " \\note_callback"]
14295 #[doc = ""]
14296 #[doc = " \\sa"]
14297 #[doc = " ::cudaGraphicsResourceGetMappedPointer,"]
14298 #[doc = " ::cudaGraphicsSubResourceGetMappedArray,"]
14299 #[doc = " ::cudaGraphicsUnmapResources,"]
14300 #[doc = " ::cuGraphicsMapResources"]
14301 pub fn cudaGraphicsMapResources(
14302 count: ::libc::c_int,
14303 resources: *mut cudaGraphicsResource_t,
14304 stream: cudaStream_t,
14305 ) -> cudaError_t;
14306}
14307extern "C" {
14308 #[doc = " \\brief Unmap graphics resources."]
14309 #[doc = ""]
14310 #[doc = " Unmaps the \\p count graphics resources in \\p resources."]
14311 #[doc = ""]
14312 #[doc = " Once unmapped, the resources in \\p resources may not be accessed by CUDA"]
14313 #[doc = " until they are mapped again."]
14314 #[doc = ""]
14315 #[doc = " This function provides the synchronization guarantee that any CUDA work issued"]
14316 #[doc = " in \\p stream before ::cudaGraphicsUnmapResources() will complete before any"]
14317 #[doc = " subsequently issued graphics work begins."]
14318 #[doc = ""]
14319 #[doc = " If \\p resources contains any duplicate entries then ::cudaErrorInvalidResourceHandle"]
14320 #[doc = " is returned. If any of \\p resources are not presently mapped for access by"]
14321 #[doc = " CUDA then ::cudaErrorUnknown is returned."]
14322 #[doc = ""]
14323 #[doc = " \\param count - Number of resources to unmap"]
14324 #[doc = " \\param resources - Resources to unmap"]
14325 #[doc = " \\param stream - Stream for synchronization"]
14326 #[doc = ""]
14327 #[doc = " \\return"]
14328 #[doc = " ::cudaSuccess,"]
14329 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14330 #[doc = " ::cudaErrorUnknown"]
14331 #[doc = " \\note_null_stream"]
14332 #[doc = " \\notefnerr"]
14333 #[doc = " \\note_init_rt"]
14334 #[doc = " \\note_callback"]
14335 #[doc = ""]
14336 #[doc = " \\sa"]
14337 #[doc = " ::cudaGraphicsMapResources,"]
14338 #[doc = " ::cuGraphicsUnmapResources"]
14339 pub fn cudaGraphicsUnmapResources(
14340 count: ::libc::c_int,
14341 resources: *mut cudaGraphicsResource_t,
14342 stream: cudaStream_t,
14343 ) -> cudaError_t;
14344}
14345extern "C" {
14346 #[doc = " \\brief Get an device pointer through which to access a mapped graphics resource."]
14347 #[doc = ""]
14348 #[doc = " Returns in \\p *devPtr a pointer through which the mapped graphics resource"]
14349 #[doc = " \\p resource may be accessed."]
14350 #[doc = " Returns in \\p *size the size of the memory in bytes which may be accessed from that pointer."]
14351 #[doc = " The value set in \\p devPtr may change every time that \\p resource is mapped."]
14352 #[doc = ""]
14353 #[doc = " If \\p resource is not a buffer then it cannot be accessed via a pointer and"]
14354 #[doc = " ::cudaErrorUnknown is returned."]
14355 #[doc = " If \\p resource is not mapped then ::cudaErrorUnknown is returned."]
14356 #[doc = " *"]
14357 #[doc = " \\param devPtr - Returned pointer through which \\p resource may be accessed"]
14358 #[doc = " \\param size - Returned size of the buffer accessible starting at \\p *devPtr"]
14359 #[doc = " \\param resource - Mapped resource to access"]
14360 #[doc = ""]
14361 #[doc = " \\return"]
14362 #[doc = " ::cudaSuccess,"]
14363 #[doc = " ::cudaErrorInvalidValue,"]
14364 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14365 #[doc = " ::cudaErrorUnknown"]
14366 #[doc = " \\notefnerr"]
14367 #[doc = " \\note_init_rt"]
14368 #[doc = " \\note_callback"]
14369 #[doc = ""]
14370 #[doc = " \\sa"]
14371 #[doc = " ::cudaGraphicsMapResources,"]
14372 #[doc = " ::cudaGraphicsSubResourceGetMappedArray,"]
14373 #[doc = " ::cuGraphicsResourceGetMappedPointer"]
14374 pub fn cudaGraphicsResourceGetMappedPointer(
14375 devPtr: *mut *mut ::libc::c_void,
14376 size: *mut usize,
14377 resource: cudaGraphicsResource_t,
14378 ) -> cudaError_t;
14379}
14380extern "C" {
14381 #[doc = " \\brief Get an array through which to access a subresource of a mapped graphics resource."]
14382 #[doc = ""]
14383 #[doc = " Returns in \\p *array an array through which the subresource of the mapped"]
14384 #[doc = " graphics resource \\p resource which corresponds to array index \\p arrayIndex"]
14385 #[doc = " and mipmap level \\p mipLevel may be accessed. The value set in \\p array may"]
14386 #[doc = " change every time that \\p resource is mapped."]
14387 #[doc = ""]
14388 #[doc = " If \\p resource is not a texture then it cannot be accessed via an array and"]
14389 #[doc = " ::cudaErrorUnknown is returned."]
14390 #[doc = " If \\p arrayIndex is not a valid array index for \\p resource then"]
14391 #[doc = " ::cudaErrorInvalidValue is returned."]
14392 #[doc = " If \\p mipLevel is not a valid mipmap level for \\p resource then"]
14393 #[doc = " ::cudaErrorInvalidValue is returned."]
14394 #[doc = " If \\p resource is not mapped then ::cudaErrorUnknown is returned."]
14395 #[doc = ""]
14396 #[doc = " \\param array - Returned array through which a subresource of \\p resource may be accessed"]
14397 #[doc = " \\param resource - Mapped resource to access"]
14398 #[doc = " \\param arrayIndex - Array index for array textures or cubemap face"]
14399 #[doc = " index as defined by ::cudaGraphicsCubeFace for"]
14400 #[doc = " cubemap textures for the subresource to access"]
14401 #[doc = " \\param mipLevel - Mipmap level for the subresource to access"]
14402 #[doc = ""]
14403 #[doc = " \\return"]
14404 #[doc = " ::cudaSuccess,"]
14405 #[doc = " ::cudaErrorInvalidValue,"]
14406 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14407 #[doc = " ::cudaErrorUnknown"]
14408 #[doc = " \\notefnerr"]
14409 #[doc = " \\note_init_rt"]
14410 #[doc = " \\note_callback"]
14411 #[doc = ""]
14412 #[doc = " \\sa"]
14413 #[doc = " ::cudaGraphicsResourceGetMappedPointer,"]
14414 #[doc = " ::cuGraphicsSubResourceGetMappedArray"]
14415 pub fn cudaGraphicsSubResourceGetMappedArray(
14416 array: *mut cudaArray_t,
14417 resource: cudaGraphicsResource_t,
14418 arrayIndex: ::libc::c_uint,
14419 mipLevel: ::libc::c_uint,
14420 ) -> cudaError_t;
14421}
14422extern "C" {
14423 #[doc = " \\brief Get a mipmapped array through which to access a mapped graphics resource."]
14424 #[doc = ""]
14425 #[doc = " Returns in \\p *mipmappedArray a mipmapped array through which the mapped"]
14426 #[doc = " graphics resource \\p resource may be accessed. The value set in \\p mipmappedArray may"]
14427 #[doc = " change every time that \\p resource is mapped."]
14428 #[doc = ""]
14429 #[doc = " If \\p resource is not a texture then it cannot be accessed via an array and"]
14430 #[doc = " ::cudaErrorUnknown is returned."]
14431 #[doc = " If \\p resource is not mapped then ::cudaErrorUnknown is returned."]
14432 #[doc = ""]
14433 #[doc = " \\param mipmappedArray - Returned mipmapped array through which \\p resource may be accessed"]
14434 #[doc = " \\param resource - Mapped resource to access"]
14435 #[doc = ""]
14436 #[doc = " \\return"]
14437 #[doc = " ::cudaSuccess,"]
14438 #[doc = " ::cudaErrorInvalidValue,"]
14439 #[doc = " ::cudaErrorInvalidResourceHandle,"]
14440 #[doc = " ::cudaErrorUnknown"]
14441 #[doc = " \\notefnerr"]
14442 #[doc = " \\note_init_rt"]
14443 #[doc = " \\note_callback"]
14444 #[doc = ""]
14445 #[doc = " \\sa"]
14446 #[doc = " ::cudaGraphicsResourceGetMappedPointer,"]
14447 #[doc = " ::cuGraphicsResourceGetMappedMipmappedArray"]
14448 pub fn cudaGraphicsResourceGetMappedMipmappedArray(
14449 mipmappedArray: *mut cudaMipmappedArray_t,
14450 resource: cudaGraphicsResource_t,
14451 ) -> cudaError_t;
14452}
14453extern "C" {
14454 #[doc = " \\brief Binds a memory area to a texture"]
14455 #[doc = ""]
14456 #[doc = " \\deprecated"]
14457 #[doc = ""]
14458 #[doc = " Binds \\p size bytes of the memory area pointed to by \\p devPtr to the"]
14459 #[doc = " texture reference \\p texref. \\p desc describes how the memory is interpreted"]
14460 #[doc = " when fetching values from the texture. Any memory previously bound to"]
14461 #[doc = " \\p texref is unbound."]
14462 #[doc = ""]
14463 #[doc = " Since the hardware enforces an alignment requirement on texture base"]
14464 #[doc = " addresses,"]
14465 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture()\""]
14466 #[doc = " returns in \\p *offset a byte offset that"]
14467 #[doc = " must be applied to texture fetches in order to read from the desired memory."]
14468 #[doc = " This offset must be divided by the texel size and passed to kernels that"]
14469 #[doc = " read from the texture so they can be applied to the ::tex1Dfetch() function."]
14470 #[doc = " If the device memory pointer was returned from ::cudaMalloc(), the offset is"]
14471 #[doc = " guaranteed to be 0 and NULL may be passed as the \\p offset parameter."]
14472 #[doc = ""]
14473 #[doc = " The total number of elements (or texels) in the linear address range"]
14474 #[doc = " cannot exceed ::cudaDeviceProp::maxTexture1DLinear[0]."]
14475 #[doc = " The number of elements is computed as (\\p size / elementSize),"]
14476 #[doc = " where elementSize is determined from \\p desc."]
14477 #[doc = ""]
14478 #[doc = " \\param offset - Offset in bytes"]
14479 #[doc = " \\param texref - Texture to bind"]
14480 #[doc = " \\param devPtr - Memory area on device"]
14481 #[doc = " \\param desc - Channel format"]
14482 #[doc = " \\param size - Size of the memory area pointed to by devPtr"]
14483 #[doc = ""]
14484 #[doc = " \\return"]
14485 #[doc = " ::cudaSuccess,"]
14486 #[doc = " ::cudaErrorInvalidValue,"]
14487 #[doc = " ::cudaErrorInvalidTexture"]
14488 #[doc = " \\notefnerr"]
14489 #[doc = " \\note_init_rt"]
14490 #[doc = " \\note_callback"]
14491 #[doc = ""]
14492 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14493 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14494 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct texture< T, dim, readMode>&, const void*, const struct cudaChannelFormatDesc&, size_t) \"cudaBindTexture (C++ API)\","]
14495 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14496 #[doc = " \\ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindTextureToArray (C API)\","]
14497 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaUnbindTexture (C API)\","]
14498 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\","]
14499 #[doc = " ::cuTexRefSetAddress,"]
14500 #[doc = " ::cuTexRefSetAddressMode,"]
14501 #[doc = " ::cuTexRefSetFormat,"]
14502 #[doc = " ::cuTexRefSetFlags,"]
14503 #[doc = " ::cuTexRefSetBorderColor"]
14504 pub fn cudaBindTexture(
14505 offset: *mut usize,
14506 texref: *const textureReference,
14507 devPtr: *const ::libc::c_void,
14508 desc: *const cudaChannelFormatDesc,
14509 size: usize,
14510 ) -> cudaError_t;
14511}
14512extern "C" {
14513 #[doc = " \\brief Binds a 2D memory area to a texture"]
14514 #[doc = ""]
14515 #[doc = " \\deprecated"]
14516 #[doc = ""]
14517 #[doc = " Binds the 2D memory area pointed to by \\p devPtr to the"]
14518 #[doc = " texture reference \\p texref. The size of the area is constrained by"]
14519 #[doc = " \\p width in texel units, \\p height in texel units, and \\p pitch in byte"]
14520 #[doc = " units. \\p desc describes how the memory is interpreted when fetching values"]
14521 #[doc = " from the texture. Any memory previously bound to \\p texref is unbound."]
14522 #[doc = ""]
14523 #[doc = " Since the hardware enforces an alignment requirement on texture base"]
14524 #[doc = " addresses, ::cudaBindTexture2D() returns in \\p *offset a byte offset that"]
14525 #[doc = " must be applied to texture fetches in order to read from the desired memory."]
14526 #[doc = " This offset must be divided by the texel size and passed to kernels that"]
14527 #[doc = " read from the texture so they can be applied to the ::tex2D() function."]
14528 #[doc = " If the device memory pointer was returned from ::cudaMalloc(), the offset is"]
14529 #[doc = " guaranteed to be 0 and NULL may be passed as the \\p offset parameter."]
14530 #[doc = ""]
14531 #[doc = " \\p width and \\p height, which are specified in elements (or texels), cannot"]
14532 #[doc = " exceed ::cudaDeviceProp::maxTexture2DLinear[0] and ::cudaDeviceProp::maxTexture2DLinear[1]"]
14533 #[doc = " respectively. \\p pitch, which is specified in bytes, cannot exceed"]
14534 #[doc = " ::cudaDeviceProp::maxTexture2DLinear[2]."]
14535 #[doc = ""]
14536 #[doc = " The driver returns ::cudaErrorInvalidValue if \\p pitch is not a multiple of"]
14537 #[doc = " ::cudaDeviceProp::texturePitchAlignment."]
14538 #[doc = ""]
14539 #[doc = " \\param offset - Offset in bytes"]
14540 #[doc = " \\param texref - Texture reference to bind"]
14541 #[doc = " \\param devPtr - 2D memory area on device"]
14542 #[doc = " \\param desc - Channel format"]
14543 #[doc = " \\param width - Width in texel units"]
14544 #[doc = " \\param height - Height in texel units"]
14545 #[doc = " \\param pitch - Pitch in bytes"]
14546 #[doc = ""]
14547 #[doc = " \\return"]
14548 #[doc = " ::cudaSuccess,"]
14549 #[doc = " ::cudaErrorInvalidValue,"]
14550 #[doc = " ::cudaErrorInvalidTexture"]
14551 #[doc = " \\notefnerr"]
14552 #[doc = " \\note_init_rt"]
14553 #[doc = " \\note_callback"]
14554 #[doc = ""]
14555 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14556 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14557 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14558 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct texture< T, dim, readMode>&, const void*, const struct cudaChannelFormatDesc&, size_t, size_t, size_t) \"cudaBindTexture2D (C++ API)\","]
14559 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct texture<T, dim, readMode>&, const void*, size_t, size_t, size_t) \"cudaBindTexture2D (C++ API, inherited channel descriptor)\","]
14560 #[doc = " \\ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindTextureToArray (C API)\","]
14561 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaBindTextureToArray (C API)\","]
14562 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\","]
14563 #[doc = " ::cuTexRefSetAddress2D,"]
14564 #[doc = " ::cuTexRefSetFormat,"]
14565 #[doc = " ::cuTexRefSetFlags,"]
14566 #[doc = " ::cuTexRefSetAddressMode,"]
14567 #[doc = " ::cuTexRefSetBorderColor"]
14568 pub fn cudaBindTexture2D(
14569 offset: *mut usize,
14570 texref: *const textureReference,
14571 devPtr: *const ::libc::c_void,
14572 desc: *const cudaChannelFormatDesc,
14573 width: usize,
14574 height: usize,
14575 pitch: usize,
14576 ) -> cudaError_t;
14577}
14578extern "C" {
14579 #[doc = " \\brief Binds an array to a texture"]
14580 #[doc = ""]
14581 #[doc = " \\deprecated"]
14582 #[doc = ""]
14583 #[doc = " Binds the CUDA array \\p array to the texture reference \\p texref."]
14584 #[doc = " \\p desc describes how the memory is interpreted when fetching values from"]
14585 #[doc = " the texture. Any CUDA array previously bound to \\p texref is unbound."]
14586 #[doc = ""]
14587 #[doc = " \\param texref - Texture to bind"]
14588 #[doc = " \\param array - Memory array on device"]
14589 #[doc = " \\param desc - Channel format"]
14590 #[doc = ""]
14591 #[doc = " \\return"]
14592 #[doc = " ::cudaSuccess,"]
14593 #[doc = " ::cudaErrorInvalidValue,"]
14594 #[doc = " ::cudaErrorInvalidTexture"]
14595 #[doc = " \\notefnerr"]
14596 #[doc = " \\note_init_rt"]
14597 #[doc = " \\note_callback"]
14598 #[doc = ""]
14599 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14600 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14601 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14602 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14603 #[doc = " \\ref ::cudaBindTextureToArray(const struct texture< T, dim, readMode>&, cudaArray_const_t, const struct cudaChannelFormatDesc&) \"cudaBindTextureToArray (C++ API)\","]
14604 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaUnbindTexture (C API)\","]
14605 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\","]
14606 #[doc = " ::cuTexRefSetArray,"]
14607 #[doc = " ::cuTexRefSetFormat,"]
14608 #[doc = " ::cuTexRefSetFlags,"]
14609 #[doc = " ::cuTexRefSetAddressMode,"]
14610 #[doc = " ::cuTexRefSetFilterMode,"]
14611 #[doc = " ::cuTexRefSetBorderColor,"]
14612 #[doc = " ::cuTexRefSetMaxAnisotropy"]
14613 pub fn cudaBindTextureToArray(
14614 texref: *const textureReference,
14615 array: cudaArray_const_t,
14616 desc: *const cudaChannelFormatDesc,
14617 ) -> cudaError_t;
14618}
14619extern "C" {
14620 #[doc = " \\brief Binds a mipmapped array to a texture"]
14621 #[doc = ""]
14622 #[doc = " \\deprecated"]
14623 #[doc = ""]
14624 #[doc = " Binds the CUDA mipmapped array \\p mipmappedArray to the texture reference \\p texref."]
14625 #[doc = " \\p desc describes how the memory is interpreted when fetching values from"]
14626 #[doc = " the texture. Any CUDA mipmapped array previously bound to \\p texref is unbound."]
14627 #[doc = ""]
14628 #[doc = " \\param texref - Texture to bind"]
14629 #[doc = " \\param mipmappedArray - Memory mipmapped array on device"]
14630 #[doc = " \\param desc - Channel format"]
14631 #[doc = ""]
14632 #[doc = " \\return"]
14633 #[doc = " ::cudaSuccess,"]
14634 #[doc = " ::cudaErrorInvalidValue,"]
14635 #[doc = " ::cudaErrorInvalidTexture"]
14636 #[doc = " \\notefnerr"]
14637 #[doc = " \\note_init_rt"]
14638 #[doc = " \\note_callback"]
14639 #[doc = ""]
14640 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14641 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14642 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14643 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14644 #[doc = " \\ref ::cudaBindTextureToArray(const struct texture< T, dim, readMode>&, cudaArray_const_t, const struct cudaChannelFormatDesc&) \"cudaBindTextureToArray (C++ API)\","]
14645 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaUnbindTexture (C API)\","]
14646 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\","]
14647 #[doc = " ::cuTexRefSetMipmappedArray,"]
14648 #[doc = " ::cuTexRefSetMipmapFilterMode,"]
14649 #[doc = " ::cuTexRefSetMipmapLevelClamp,"]
14650 #[doc = " ::cuTexRefSetMipmapLevelBias,"]
14651 #[doc = " ::cuTexRefSetFormat,"]
14652 #[doc = " ::cuTexRefSetFlags,"]
14653 #[doc = " ::cuTexRefSetAddressMode,"]
14654 #[doc = " ::cuTexRefSetBorderColor,"]
14655 #[doc = " ::cuTexRefSetMaxAnisotropy"]
14656 pub fn cudaBindTextureToMipmappedArray(
14657 texref: *const textureReference,
14658 mipmappedArray: cudaMipmappedArray_const_t,
14659 desc: *const cudaChannelFormatDesc,
14660 ) -> cudaError_t;
14661}
14662extern "C" {
14663 #[doc = " \\brief Unbinds a texture"]
14664 #[doc = ""]
14665 #[doc = " \\deprecated"]
14666 #[doc = ""]
14667 #[doc = " Unbinds the texture bound to \\p texref. If \\p texref is not currently bound, no operation is performed."]
14668 #[doc = ""]
14669 #[doc = " \\param texref - Texture to unbind"]
14670 #[doc = ""]
14671 #[doc = " \\return"]
14672 #[doc = " ::cudaSuccess,"]
14673 #[doc = " ::cudaErrorInvalidTexture"]
14674 #[doc = " \\notefnerr"]
14675 #[doc = " \\note_init_rt"]
14676 #[doc = " \\note_callback"]
14677 #[doc = ""]
14678 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14679 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14680 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14681 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14682 #[doc = " \\ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindTextureToArray (C API)\","]
14683 #[doc = " \\ref ::cudaUnbindTexture(const struct texture< T, dim, readMode>&) \"cudaUnbindTexture (C++ API)\","]
14684 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\""]
14685 pub fn cudaUnbindTexture(texref: *const textureReference) -> cudaError_t;
14686}
14687extern "C" {
14688 #[doc = " \\brief Get the alignment offset of a texture"]
14689 #[doc = ""]
14690 #[doc = " \\deprecated"]
14691 #[doc = ""]
14692 #[doc = " Returns in \\p *offset the offset that was returned when texture reference"]
14693 #[doc = " \\p texref was bound."]
14694 #[doc = ""]
14695 #[doc = " \\param offset - Offset of texture reference in bytes"]
14696 #[doc = " \\param texref - Texture to get offset of"]
14697 #[doc = ""]
14698 #[doc = " \\return"]
14699 #[doc = " ::cudaSuccess,"]
14700 #[doc = " ::cudaErrorInvalidTexture,"]
14701 #[doc = " ::cudaErrorInvalidTextureBinding"]
14702 #[doc = " \\notefnerr"]
14703 #[doc = " \\note_init_rt"]
14704 #[doc = " \\note_callback"]
14705 #[doc = ""]
14706 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14707 #[doc = " ::cudaGetChannelDesc, ::cudaGetTextureReference,"]
14708 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14709 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14710 #[doc = " \\ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindTextureToArray (C API)\","]
14711 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaUnbindTexture (C API)\","]
14712 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct texture< T, dim, readMode>&) \"cudaGetTextureAlignmentOffset (C++ API)\""]
14713 pub fn cudaGetTextureAlignmentOffset(
14714 offset: *mut usize,
14715 texref: *const textureReference,
14716 ) -> cudaError_t;
14717}
14718extern "C" {
14719 #[doc = " \\brief Get the texture reference associated with a symbol"]
14720 #[doc = ""]
14721 #[doc = " \\deprecated"]
14722 #[doc = ""]
14723 #[doc = " Returns in \\p *texref the structure associated to the texture reference"]
14724 #[doc = " defined by symbol \\p symbol."]
14725 #[doc = ""]
14726 #[doc = " \\param texref - Texture reference associated with symbol"]
14727 #[doc = " \\param symbol - Texture to get reference for"]
14728 #[doc = ""]
14729 #[doc = " \\return"]
14730 #[doc = " ::cudaSuccess,"]
14731 #[doc = " ::cudaErrorInvalidTexture"]
14732 #[doc = " \\notefnerr"]
14733 #[doc = " \\note_string_api_deprecation_50"]
14734 #[doc = " \\note_init_rt"]
14735 #[doc = " \\note_callback"]
14736 #[doc = ""]
14737 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14738 #[doc = " ::cudaGetChannelDesc,"]
14739 #[doc = " \\ref ::cudaGetTextureAlignmentOffset(size_t*, const struct textureReference*) \"cudaGetTextureAlignmentOffset (C API)\","]
14740 #[doc = " \\ref ::cudaBindTexture(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t) \"cudaBindTexture (C API)\","]
14741 #[doc = " \\ref ::cudaBindTexture2D(size_t*, const struct textureReference*, const void*, const struct cudaChannelFormatDesc*, size_t, size_t, size_t) \"cudaBindTexture2D (C API)\","]
14742 #[doc = " \\ref ::cudaBindTextureToArray(const struct textureReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindTextureToArray (C API)\","]
14743 #[doc = " \\ref ::cudaUnbindTexture(const struct textureReference*) \"cudaUnbindTexture (C API)\","]
14744 #[doc = " ::cuModuleGetTexRef"]
14745 pub fn cudaGetTextureReference(
14746 texref: *mut *const textureReference,
14747 symbol: *const ::libc::c_void,
14748 ) -> cudaError_t;
14749}
14750extern "C" {
14751 #[doc = " \\brief Binds an array to a surface"]
14752 #[doc = ""]
14753 #[doc = " \\deprecated"]
14754 #[doc = ""]
14755 #[doc = " Binds the CUDA array \\p array to the surface reference \\p surfref."]
14756 #[doc = " \\p desc describes how the memory is interpreted when fetching values from"]
14757 #[doc = " the surface. Any CUDA array previously bound to \\p surfref is unbound."]
14758 #[doc = ""]
14759 #[doc = " \\param surfref - Surface to bind"]
14760 #[doc = " \\param array - Memory array on device"]
14761 #[doc = " \\param desc - Channel format"]
14762 #[doc = ""]
14763 #[doc = " \\return"]
14764 #[doc = " ::cudaSuccess,"]
14765 #[doc = " ::cudaErrorInvalidValue,"]
14766 #[doc = " ::cudaErrorInvalidSurface"]
14767 #[doc = " \\notefnerr"]
14768 #[doc = " \\note_init_rt"]
14769 #[doc = " \\note_callback"]
14770 #[doc = ""]
14771 #[doc = " \\sa \\ref ::cudaBindSurfaceToArray(const struct surface< T, dim>&, cudaArray_const_t, const struct cudaChannelFormatDesc&) \"cudaBindSurfaceToArray (C++ API)\","]
14772 #[doc = " \\ref ::cudaBindSurfaceToArray(const struct surface< T, dim>&, cudaArray_const_t) \"cudaBindSurfaceToArray (C++ API, inherited channel descriptor)\","]
14773 #[doc = " ::cudaGetSurfaceReference,"]
14774 #[doc = " ::cuSurfRefSetArray"]
14775 pub fn cudaBindSurfaceToArray(
14776 surfref: *const surfaceReference,
14777 array: cudaArray_const_t,
14778 desc: *const cudaChannelFormatDesc,
14779 ) -> cudaError_t;
14780}
14781extern "C" {
14782 #[doc = " \\brief Get the surface reference associated with a symbol"]
14783 #[doc = ""]
14784 #[doc = " \\deprecated"]
14785 #[doc = ""]
14786 #[doc = " Returns in \\p *surfref the structure associated to the surface reference"]
14787 #[doc = " defined by symbol \\p symbol."]
14788 #[doc = ""]
14789 #[doc = " \\param surfref - Surface reference associated with symbol"]
14790 #[doc = " \\param symbol - Surface to get reference for"]
14791 #[doc = ""]
14792 #[doc = " \\return"]
14793 #[doc = " ::cudaSuccess,"]
14794 #[doc = " ::cudaErrorInvalidSurface"]
14795 #[doc = " \\notefnerr"]
14796 #[doc = " \\note_string_api_deprecation_50"]
14797 #[doc = " \\note_init_rt"]
14798 #[doc = " \\note_callback"]
14799 #[doc = ""]
14800 #[doc = " \\sa"]
14801 #[doc = " \\ref ::cudaBindSurfaceToArray(const struct surfaceReference*, cudaArray_const_t, const struct cudaChannelFormatDesc*) \"cudaBindSurfaceToArray (C API)\","]
14802 #[doc = " ::cuModuleGetSurfRef"]
14803 pub fn cudaGetSurfaceReference(
14804 surfref: *mut *const surfaceReference,
14805 symbol: *const ::libc::c_void,
14806 ) -> cudaError_t;
14807}
14808extern "C" {
14809 #[doc = " \\brief Get the channel descriptor of an array"]
14810 #[doc = ""]
14811 #[doc = " Returns in \\p *desc the channel descriptor of the CUDA array \\p array."]
14812 #[doc = ""]
14813 #[doc = " \\param desc - Channel format"]
14814 #[doc = " \\param array - Memory array on device"]
14815 #[doc = ""]
14816 #[doc = " \\return"]
14817 #[doc = " ::cudaSuccess,"]
14818 #[doc = " ::cudaErrorInvalidValue"]
14819 #[doc = " \\notefnerr"]
14820 #[doc = " \\note_init_rt"]
14821 #[doc = " \\note_callback"]
14822 #[doc = ""]
14823 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(int, int, int, int, cudaChannelFormatKind) \"cudaCreateChannelDesc (C API)\","]
14824 #[doc = " ::cudaCreateTextureObject, ::cudaCreateSurfaceObject"]
14825 pub fn cudaGetChannelDesc(
14826 desc: *mut cudaChannelFormatDesc,
14827 array: cudaArray_const_t,
14828 ) -> cudaError_t;
14829}
14830extern "C" {
14831 #[doc = " \\brief Returns a channel descriptor using the specified format"]
14832 #[doc = ""]
14833 #[doc = " Returns a channel descriptor with format \\p f and number of bits of each"]
14834 #[doc = " component \\p x, \\p y, \\p z, and \\p w. The ::cudaChannelFormatDesc is"]
14835 #[doc = " defined as:"]
14836 #[doc = " \\code"]
14837 #[doc = "struct cudaChannelFormatDesc {"]
14838 #[doc = "int x, y, z, w;"]
14839 #[doc = "enum cudaChannelFormatKind f;"]
14840 #[doc = "};"]
14841 #[doc = " \\endcode"]
14842 #[doc = ""]
14843 #[doc = " where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned,"]
14844 #[doc = " ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat."]
14845 #[doc = ""]
14846 #[doc = " \\param x - X component"]
14847 #[doc = " \\param y - Y component"]
14848 #[doc = " \\param z - Z component"]
14849 #[doc = " \\param w - W component"]
14850 #[doc = " \\param f - Channel format"]
14851 #[doc = ""]
14852 #[doc = " \\return"]
14853 #[doc = " Channel descriptor with format \\p f"]
14854 #[doc = ""]
14855 #[doc = " \\sa \\ref ::cudaCreateChannelDesc(void) \"cudaCreateChannelDesc (C++ API)\","]
14856 #[doc = " ::cudaGetChannelDesc, ::cudaCreateTextureObject, ::cudaCreateSurfaceObject"]
14857 pub fn cudaCreateChannelDesc(
14858 x: ::libc::c_int,
14859 y: ::libc::c_int,
14860 z: ::libc::c_int,
14861 w: ::libc::c_int,
14862 f: cudaChannelFormatKind,
14863 ) -> cudaChannelFormatDesc;
14864}
14865extern "C" {
14866 #[doc = " \\brief Creates a texture object"]
14867 #[doc = ""]
14868 #[doc = " Creates a texture object and returns it in \\p pTexObject. \\p pResDesc describes"]
14869 #[doc = " the data to texture from. \\p pTexDesc describes how the data should be sampled."]
14870 #[doc = " \\p pResViewDesc is an optional argument that specifies an alternate format for"]
14871 #[doc = " the data described by \\p pResDesc, and also describes the subresource region"]
14872 #[doc = " to restrict access to when texturing. \\p pResViewDesc can only be specified if"]
14873 #[doc = " the type of resource is a CUDA array or a CUDA mipmapped array."]
14874 #[doc = ""]
14875 #[doc = " Texture objects are only supported on devices of compute capability 3.0 or higher."]
14876 #[doc = " Additionally, a texture object is an opaque value, and, as such, should only be"]
14877 #[doc = " accessed through CUDA API calls."]
14878 #[doc = ""]
14879 #[doc = " The ::cudaResourceDesc structure is defined as:"]
14880 #[doc = " \\code"]
14881 #[doc = "struct cudaResourceDesc {"]
14882 #[doc = "enum cudaResourceType resType;"]
14883 #[doc = ""]
14884 #[doc = "union {"]
14885 #[doc = "struct {"]
14886 #[doc = "cudaArray_t array;"]
14887 #[doc = "} array;"]
14888 #[doc = "struct {"]
14889 #[doc = "cudaMipmappedArray_t mipmap;"]
14890 #[doc = "} mipmap;"]
14891 #[doc = "struct {"]
14892 #[doc = "void *devPtr;"]
14893 #[doc = "struct cudaChannelFormatDesc desc;"]
14894 #[doc = "size_t sizeInBytes;"]
14895 #[doc = "} linear;"]
14896 #[doc = "struct {"]
14897 #[doc = "void *devPtr;"]
14898 #[doc = "struct cudaChannelFormatDesc desc;"]
14899 #[doc = "size_t width;"]
14900 #[doc = "size_t height;"]
14901 #[doc = "size_t pitchInBytes;"]
14902 #[doc = "} pitch2D;"]
14903 #[doc = "} res;"]
14904 #[doc = "};"]
14905 #[doc = " \\endcode"]
14906 #[doc = " where:"]
14907 #[doc = " - ::cudaResourceDesc::resType specifies the type of resource to texture from."]
14908 #[doc = " CUresourceType is defined as:"]
14909 #[doc = " \\code"]
14910 #[doc = "enum cudaResourceType {"]
14911 #[doc = "cudaResourceTypeArray = 0x00,"]
14912 #[doc = "cudaResourceTypeMipmappedArray = 0x01,"]
14913 #[doc = "cudaResourceTypeLinear = 0x02,"]
14914 #[doc = "cudaResourceTypePitch2D = 0x03"]
14915 #[doc = "};"]
14916 #[doc = " \\endcode"]
14917 #[doc = ""]
14918 #[doc = " \\par"]
14919 #[doc = " If ::cudaResourceDesc::resType is set to ::cudaResourceTypeArray, ::cudaResourceDesc::res::array::array"]
14920 #[doc = " must be set to a valid CUDA array handle."]
14921 #[doc = ""]
14922 #[doc = " \\par"]
14923 #[doc = " If ::cudaResourceDesc::resType is set to ::cudaResourceTypeMipmappedArray, ::cudaResourceDesc::res::mipmap::mipmap"]
14924 #[doc = " must be set to a valid CUDA mipmapped array handle and ::cudaTextureDesc::normalizedCoords must be set to true."]
14925 #[doc = ""]
14926 #[doc = " \\par"]
14927 #[doc = " If ::cudaResourceDesc::resType is set to ::cudaResourceTypeLinear, ::cudaResourceDesc::res::linear::devPtr"]
14928 #[doc = " must be set to a valid device pointer, that is aligned to ::cudaDeviceProp::textureAlignment."]
14929 #[doc = " ::cudaResourceDesc::res::linear::desc describes the format and the number of components per array element. ::cudaResourceDesc::res::linear::sizeInBytes"]
14930 #[doc = " specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed"]
14931 #[doc = " ::cudaDeviceProp::maxTexture1DLinear. The number of elements is computed as (sizeInBytes / sizeof(desc))."]
14932 #[doc = ""]
14933 #[doc = " \\par"]
14934 #[doc = " If ::cudaResourceDesc::resType is set to ::cudaResourceTypePitch2D, ::cudaResourceDesc::res::pitch2D::devPtr"]
14935 #[doc = " must be set to a valid device pointer, that is aligned to ::cudaDeviceProp::textureAlignment."]
14936 #[doc = " ::cudaResourceDesc::res::pitch2D::desc describes the format and the number of components per array element. ::cudaResourceDesc::res::pitch2D::width"]
14937 #[doc = " and ::cudaResourceDesc::res::pitch2D::height specify the width and height of the array in elements, and cannot exceed"]
14938 #[doc = " ::cudaDeviceProp::maxTexture2DLinear[0] and ::cudaDeviceProp::maxTexture2DLinear[1] respectively."]
14939 #[doc = " ::cudaResourceDesc::res::pitch2D::pitchInBytes specifies the pitch between two rows in bytes and has to be aligned to"]
14940 #[doc = " ::cudaDeviceProp::texturePitchAlignment. Pitch cannot exceed ::cudaDeviceProp::maxTexture2DLinear[2]."]
14941 #[doc = ""]
14942 #[doc = ""]
14943 #[doc = " The ::cudaTextureDesc struct is defined as"]
14944 #[doc = " \\code"]
14945 #[doc = "struct cudaTextureDesc {"]
14946 #[doc = "enum cudaTextureAddressMode addressMode[3];"]
14947 #[doc = "enum cudaTextureFilterMode filterMode;"]
14948 #[doc = "enum cudaTextureReadMode readMode;"]
14949 #[doc = "int sRGB;"]
14950 #[doc = "float borderColor[4];"]
14951 #[doc = "int normalizedCoords;"]
14952 #[doc = "unsigned int maxAnisotropy;"]
14953 #[doc = "enum cudaTextureFilterMode mipmapFilterMode;"]
14954 #[doc = "float mipmapLevelBias;"]
14955 #[doc = "float minMipmapLevelClamp;"]
14956 #[doc = "float maxMipmapLevelClamp;"]
14957 #[doc = "int disableTrilinearOptimization;"]
14958 #[doc = "};"]
14959 #[doc = " \\endcode"]
14960 #[doc = " where"]
14961 #[doc = " - ::cudaTextureDesc::addressMode specifies the addressing mode for each dimension of the texture data. ::cudaTextureAddressMode is defined as:"]
14962 #[doc = " \\code"]
14963 #[doc = "enum cudaTextureAddressMode {"]
14964 #[doc = "cudaAddressModeWrap = 0,"]
14965 #[doc = "cudaAddressModeClamp = 1,"]
14966 #[doc = "cudaAddressModeMirror = 2,"]
14967 #[doc = "cudaAddressModeBorder = 3"]
14968 #[doc = "};"]
14969 #[doc = " \\endcode"]
14970 #[doc = " This is ignored if ::cudaResourceDesc::resType is ::cudaResourceTypeLinear. Also, if ::cudaTextureDesc::normalizedCoords"]
14971 #[doc = " is set to zero, ::cudaAddressModeWrap and ::cudaAddressModeMirror won't be supported and will be switched to ::cudaAddressModeClamp."]
14972 #[doc = ""]
14973 #[doc = " - ::cudaTextureDesc::filterMode specifies the filtering mode to be used when fetching from the texture. ::cudaTextureFilterMode is defined as:"]
14974 #[doc = " \\code"]
14975 #[doc = "enum cudaTextureFilterMode {"]
14976 #[doc = "cudaFilterModePoint = 0,"]
14977 #[doc = "cudaFilterModeLinear = 1"]
14978 #[doc = "};"]
14979 #[doc = " \\endcode"]
14980 #[doc = " This is ignored if ::cudaResourceDesc::resType is ::cudaResourceTypeLinear."]
14981 #[doc = ""]
14982 #[doc = " - ::cudaTextureDesc::readMode specifies whether integer data should be converted to floating point or not. ::cudaTextureReadMode is defined as:"]
14983 #[doc = " \\code"]
14984 #[doc = "enum cudaTextureReadMode {"]
14985 #[doc = "cudaReadModeElementType = 0,"]
14986 #[doc = "cudaReadModeNormalizedFloat = 1"]
14987 #[doc = "};"]
14988 #[doc = " \\endcode"]
14989 #[doc = " Note that this applies only to 8-bit and 16-bit integer formats. 32-bit integer format would not be promoted, regardless of"]
14990 #[doc = " whether or not this ::cudaTextureDesc::readMode is set ::cudaReadModeNormalizedFloat is specified."]
14991 #[doc = ""]
14992 #[doc = " - ::cudaTextureDesc::sRGB specifies whether sRGB to linear conversion should be performed during texture fetch."]
14993 #[doc = ""]
14994 #[doc = " - ::cudaTextureDesc::borderColor specifies the float values of color. where:"]
14995 #[doc = " ::cudaTextureDesc::borderColor[0] contains value of 'R',"]
14996 #[doc = " ::cudaTextureDesc::borderColor[1] contains value of 'G',"]
14997 #[doc = " ::cudaTextureDesc::borderColor[2] contains value of 'B',"]
14998 #[doc = " ::cudaTextureDesc::borderColor[3] contains value of 'A'"]
14999 #[doc = " Note that application using integer border color values will need to <reinterpret_cast> these values to float."]
15000 #[doc = " The values are set only when the addressing mode specified by ::cudaTextureDesc::addressMode is cudaAddressModeBorder."]
15001 #[doc = ""]
15002 #[doc = " - ::cudaTextureDesc::normalizedCoords specifies whether the texture coordinates will be normalized or not."]
15003 #[doc = ""]
15004 #[doc = " - ::cudaTextureDesc::maxAnisotropy specifies the maximum anistropy ratio to be used when doing anisotropic filtering. This value will be"]
15005 #[doc = " clamped to the range [1,16]."]
15006 #[doc = ""]
15007 #[doc = " - ::cudaTextureDesc::mipmapFilterMode specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels."]
15008 #[doc = ""]
15009 #[doc = " - ::cudaTextureDesc::mipmapLevelBias specifies the offset to be applied to the calculated mipmap level."]
15010 #[doc = ""]
15011 #[doc = " - ::cudaTextureDesc::minMipmapLevelClamp specifies the lower end of the mipmap level range to clamp access to."]
15012 #[doc = ""]
15013 #[doc = " - ::cudaTextureDesc::maxMipmapLevelClamp specifies the upper end of the mipmap level range to clamp access to."]
15014 #[doc = ""]
15015 #[doc = " - ::cudaTextureDesc::disableTrilinearOptimization specifies whether the trilinear filtering optimizations will be disabled."]
15016 #[doc = ""]
15017 #[doc = ""]
15018 #[doc = " The ::cudaResourceViewDesc struct is defined as"]
15019 #[doc = " \\code"]
15020 #[doc = "struct cudaResourceViewDesc {"]
15021 #[doc = "enum cudaResourceViewFormat format;"]
15022 #[doc = "size_t width;"]
15023 #[doc = "size_t height;"]
15024 #[doc = "size_t depth;"]
15025 #[doc = "unsigned int firstMipmapLevel;"]
15026 #[doc = "unsigned int lastMipmapLevel;"]
15027 #[doc = "unsigned int firstLayer;"]
15028 #[doc = "unsigned int lastLayer;"]
15029 #[doc = "};"]
15030 #[doc = " \\endcode"]
15031 #[doc = " where:"]
15032 #[doc = " - ::cudaResourceViewDesc::format specifies how the data contained in the CUDA array or CUDA mipmapped array should"]
15033 #[doc = " be interpreted. Note that this can incur a change in size of the texture data. If the resource view format is a block"]
15034 #[doc = " compressed format, then the underlying CUDA array or CUDA mipmapped array has to have a 32-bit unsigned integer format"]
15035 #[doc = " with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to have"]
15036 #[doc = " a 32-bit unsigned int with 2 channels. The other BC formats require the underlying resource to have the same 32-bit unsigned int"]
15037 #[doc = " format but with 4 channels."]
15038 #[doc = ""]
15039 #[doc = " - ::cudaResourceViewDesc::width specifies the new width of the texture data. If the resource view format is a block"]
15040 #[doc = " compressed format, this value has to be 4 times the original width of the resource. For non block compressed formats,"]
15041 #[doc = " this value has to be equal to that of the original resource."]
15042 #[doc = ""]
15043 #[doc = " - ::cudaResourceViewDesc::height specifies the new height of the texture data. If the resource view format is a block"]
15044 #[doc = " compressed format, this value has to be 4 times the original height of the resource. For non block compressed formats,"]
15045 #[doc = " this value has to be equal to that of the original resource."]
15046 #[doc = ""]
15047 #[doc = " - ::cudaResourceViewDesc::depth specifies the new depth of the texture data. This value has to be equal to that of the"]
15048 #[doc = " original resource."]
15049 #[doc = ""]
15050 #[doc = " - ::cudaResourceViewDesc::firstMipmapLevel specifies the most detailed mipmap level. This will be the new mipmap level zero."]
15051 #[doc = " For non-mipmapped resources, this value has to be zero.::cudaTextureDesc::minMipmapLevelClamp and ::cudaTextureDesc::maxMipmapLevelClamp"]
15052 #[doc = " will be relative to this value. For ex., if the firstMipmapLevel is set to 2, and a minMipmapLevelClamp of 1.2 is specified,"]
15053 #[doc = " then the actual minimum mipmap level clamp will be 3.2."]
15054 #[doc = ""]
15055 #[doc = " - ::cudaResourceViewDesc::lastMipmapLevel specifies the least detailed mipmap level. For non-mipmapped resources, this value"]
15056 #[doc = " has to be zero."]
15057 #[doc = ""]
15058 #[doc = " - ::cudaResourceViewDesc::firstLayer specifies the first layer index for layered textures. This will be the new layer zero."]
15059 #[doc = " For non-layered resources, this value has to be zero."]
15060 #[doc = ""]
15061 #[doc = " - ::cudaResourceViewDesc::lastLayer specifies the last layer index for layered textures. For non-layered resources,"]
15062 #[doc = " this value has to be zero."]
15063 #[doc = ""]
15064 #[doc = ""]
15065 #[doc = " \\param pTexObject - Texture object to create"]
15066 #[doc = " \\param pResDesc - Resource descriptor"]
15067 #[doc = " \\param pTexDesc - Texture descriptor"]
15068 #[doc = " \\param pResViewDesc - Resource view descriptor"]
15069 #[doc = ""]
15070 #[doc = " \\return"]
15071 #[doc = " ::cudaSuccess,"]
15072 #[doc = " ::cudaErrorInvalidValue"]
15073 #[doc = " \\note_init_rt"]
15074 #[doc = " \\note_callback"]
15075 #[doc = ""]
15076 #[doc = " \\sa"]
15077 #[doc = " ::cudaDestroyTextureObject,"]
15078 #[doc = " ::cuTexObjectCreate"]
15079 pub fn cudaCreateTextureObject(
15080 pTexObject: *mut cudaTextureObject_t,
15081 pResDesc: *const cudaResourceDesc,
15082 pTexDesc: *const cudaTextureDesc,
15083 pResViewDesc: *const cudaResourceViewDesc,
15084 ) -> cudaError_t;
15085}
15086extern "C" {
15087 #[doc = " \\brief Destroys a texture object"]
15088 #[doc = ""]
15089 #[doc = " Destroys the texture object specified by \\p texObject."]
15090 #[doc = ""]
15091 #[doc = " \\param texObject - Texture object to destroy"]
15092 #[doc = ""]
15093 #[doc = " \\return"]
15094 #[doc = " ::cudaSuccess,"]
15095 #[doc = " ::cudaErrorInvalidValue"]
15096 #[doc = " \\note_init_rt"]
15097 #[doc = " \\note_callback"]
15098 #[doc = " \\note_destroy_ub"]
15099 #[doc = ""]
15100 #[doc = " \\sa"]
15101 #[doc = " ::cudaCreateTextureObject,"]
15102 #[doc = " ::cuTexObjectDestroy"]
15103 pub fn cudaDestroyTextureObject(texObject: cudaTextureObject_t) -> cudaError_t;
15104}
15105extern "C" {
15106 #[doc = " \\brief Returns a texture object's resource descriptor"]
15107 #[doc = ""]
15108 #[doc = " Returns the resource descriptor for the texture object specified by \\p texObject."]
15109 #[doc = ""]
15110 #[doc = " \\param pResDesc - Resource descriptor"]
15111 #[doc = " \\param texObject - Texture object"]
15112 #[doc = ""]
15113 #[doc = " \\return"]
15114 #[doc = " ::cudaSuccess,"]
15115 #[doc = " ::cudaErrorInvalidValue"]
15116 #[doc = " \\note_init_rt"]
15117 #[doc = " \\note_callback"]
15118 #[doc = ""]
15119 #[doc = " \\sa"]
15120 #[doc = " ::cudaCreateTextureObject,"]
15121 #[doc = " ::cuTexObjectGetResourceDesc"]
15122 pub fn cudaGetTextureObjectResourceDesc(
15123 pResDesc: *mut cudaResourceDesc,
15124 texObject: cudaTextureObject_t,
15125 ) -> cudaError_t;
15126}
15127extern "C" {
15128 #[doc = " \\brief Returns a texture object's texture descriptor"]
15129 #[doc = ""]
15130 #[doc = " Returns the texture descriptor for the texture object specified by \\p texObject."]
15131 #[doc = ""]
15132 #[doc = " \\param pTexDesc - Texture descriptor"]
15133 #[doc = " \\param texObject - Texture object"]
15134 #[doc = ""]
15135 #[doc = " \\return"]
15136 #[doc = " ::cudaSuccess,"]
15137 #[doc = " ::cudaErrorInvalidValue"]
15138 #[doc = " \\note_init_rt"]
15139 #[doc = " \\note_callback"]
15140 #[doc = ""]
15141 #[doc = " \\sa"]
15142 #[doc = " ::cudaCreateTextureObject,"]
15143 #[doc = " ::cuTexObjectGetTextureDesc"]
15144 pub fn cudaGetTextureObjectTextureDesc(
15145 pTexDesc: *mut cudaTextureDesc,
15146 texObject: cudaTextureObject_t,
15147 ) -> cudaError_t;
15148}
15149extern "C" {
15150 #[doc = " \\brief Returns a texture object's resource view descriptor"]
15151 #[doc = ""]
15152 #[doc = " Returns the resource view descriptor for the texture object specified by \\p texObject."]
15153 #[doc = " If no resource view was specified, ::cudaErrorInvalidValue is returned."]
15154 #[doc = ""]
15155 #[doc = " \\param pResViewDesc - Resource view descriptor"]
15156 #[doc = " \\param texObject - Texture object"]
15157 #[doc = ""]
15158 #[doc = " \\return"]
15159 #[doc = " ::cudaSuccess,"]
15160 #[doc = " ::cudaErrorInvalidValue"]
15161 #[doc = " \\note_init_rt"]
15162 #[doc = " \\note_callback"]
15163 #[doc = ""]
15164 #[doc = " \\sa"]
15165 #[doc = " ::cudaCreateTextureObject,"]
15166 #[doc = " ::cuTexObjectGetResourceViewDesc"]
15167 pub fn cudaGetTextureObjectResourceViewDesc(
15168 pResViewDesc: *mut cudaResourceViewDesc,
15169 texObject: cudaTextureObject_t,
15170 ) -> cudaError_t;
15171}
15172extern "C" {
15173 #[doc = " \\brief Creates a surface object"]
15174 #[doc = ""]
15175 #[doc = " Creates a surface object and returns it in \\p pSurfObject. \\p pResDesc describes"]
15176 #[doc = " the data to perform surface load/stores on. ::cudaResourceDesc::resType must be"]
15177 #[doc = " ::cudaResourceTypeArray and ::cudaResourceDesc::res::array::array"]
15178 #[doc = " must be set to a valid CUDA array handle."]
15179 #[doc = ""]
15180 #[doc = " Surface objects are only supported on devices of compute capability 3.0 or higher."]
15181 #[doc = " Additionally, a surface object is an opaque value, and, as such, should only be"]
15182 #[doc = " accessed through CUDA API calls."]
15183 #[doc = ""]
15184 #[doc = " \\param pSurfObject - Surface object to create"]
15185 #[doc = " \\param pResDesc - Resource descriptor"]
15186 #[doc = ""]
15187 #[doc = " \\return"]
15188 #[doc = " ::cudaSuccess,"]
15189 #[doc = " ::cudaErrorInvalidValue,"]
15190 #[doc = " ::cudaErrorInvalidChannelDescriptor,"]
15191 #[doc = " ::cudaErrorInvalidResourceHandle"]
15192 #[doc = " \\note_init_rt"]
15193 #[doc = " \\note_callback"]
15194 #[doc = ""]
15195 #[doc = " \\sa"]
15196 #[doc = " ::cudaDestroySurfaceObject,"]
15197 #[doc = " ::cuSurfObjectCreate"]
15198 pub fn cudaCreateSurfaceObject(
15199 pSurfObject: *mut cudaSurfaceObject_t,
15200 pResDesc: *const cudaResourceDesc,
15201 ) -> cudaError_t;
15202}
15203extern "C" {
15204 #[doc = " \\brief Destroys a surface object"]
15205 #[doc = ""]
15206 #[doc = " Destroys the surface object specified by \\p surfObject."]
15207 #[doc = ""]
15208 #[doc = " \\param surfObject - Surface object to destroy"]
15209 #[doc = ""]
15210 #[doc = " \\return"]
15211 #[doc = " ::cudaSuccess,"]
15212 #[doc = " ::cudaErrorInvalidValue"]
15213 #[doc = " \\note_init_rt"]
15214 #[doc = " \\note_callback"]
15215 #[doc = " \\note_destroy_ub"]
15216 #[doc = ""]
15217 #[doc = " \\sa"]
15218 #[doc = " ::cudaCreateSurfaceObject,"]
15219 #[doc = " ::cuSurfObjectDestroy"]
15220 pub fn cudaDestroySurfaceObject(surfObject: cudaSurfaceObject_t) -> cudaError_t;
15221}
15222extern "C" {
15223 #[doc = " \\brief Returns a surface object's resource descriptor"]
15224 #[doc = " Returns the resource descriptor for the surface object specified by \\p surfObject."]
15225 #[doc = ""]
15226 #[doc = " \\param pResDesc - Resource descriptor"]
15227 #[doc = " \\param surfObject - Surface object"]
15228 #[doc = ""]
15229 #[doc = " \\return"]
15230 #[doc = " ::cudaSuccess,"]
15231 #[doc = " ::cudaErrorInvalidValue"]
15232 #[doc = " \\note_init_rt"]
15233 #[doc = " \\note_callback"]
15234 #[doc = ""]
15235 #[doc = " \\sa"]
15236 #[doc = " ::cudaCreateSurfaceObject,"]
15237 #[doc = " ::cuSurfObjectGetResourceDesc"]
15238 pub fn cudaGetSurfaceObjectResourceDesc(
15239 pResDesc: *mut cudaResourceDesc,
15240 surfObject: cudaSurfaceObject_t,
15241 ) -> cudaError_t;
15242}
15243extern "C" {
15244 #[doc = " \\brief Returns the latest version of CUDA supported by the driver"]
15245 #[doc = ""]
15246 #[doc = " Returns in \\p *driverVersion the latest version of CUDA supported by"]
15247 #[doc = " the driver. The version is returned as (1000 × major + 10 × minor)."]
15248 #[doc = " For example, CUDA 9.2 would be represented by 9020. If no driver is installed,"]
15249 #[doc = " then 0 is returned as the driver version."]
15250 #[doc = ""]
15251 #[doc = " This function automatically returns ::cudaErrorInvalidValue"]
15252 #[doc = " if \\p driverVersion is NULL."]
15253 #[doc = ""]
15254 #[doc = " \\param driverVersion - Returns the CUDA driver version."]
15255 #[doc = ""]
15256 #[doc = " \\return"]
15257 #[doc = " ::cudaSuccess,"]
15258 #[doc = " ::cudaErrorInvalidValue"]
15259 #[doc = " \\notefnerr"]
15260 #[doc = " \\note_init_rt"]
15261 #[doc = " \\note_callback"]
15262 #[doc = ""]
15263 #[doc = " \\sa"]
15264 #[doc = " ::cudaRuntimeGetVersion,"]
15265 #[doc = " ::cuDriverGetVersion"]
15266 pub fn cudaDriverGetVersion(driverVersion: *mut ::libc::c_int) -> cudaError_t;
15267}
15268extern "C" {
15269 #[doc = " \\brief Returns the CUDA Runtime version"]
15270 #[doc = ""]
15271 #[doc = " Returns in \\p *runtimeVersion the version number of the current CUDA"]
15272 #[doc = " Runtime instance. The version is returned as"]
15273 #[doc = " (1000 × major + 10 × minor). For example,"]
15274 #[doc = " CUDA 9.2 would be represented by 9020."]
15275 #[doc = ""]
15276 #[doc = " This function automatically returns ::cudaErrorInvalidValue if"]
15277 #[doc = " the \\p runtimeVersion argument is NULL."]
15278 #[doc = ""]
15279 #[doc = " \\param runtimeVersion - Returns the CUDA Runtime version."]
15280 #[doc = ""]
15281 #[doc = " \\return"]
15282 #[doc = " ::cudaSuccess,"]
15283 #[doc = " ::cudaErrorInvalidValue"]
15284 #[doc = " \\note_init_rt"]
15285 #[doc = " \\note_callback"]
15286 #[doc = ""]
15287 #[doc = " \\sa"]
15288 #[doc = " ::cudaDriverGetVersion,"]
15289 #[doc = " ::cuDriverGetVersion"]
15290 pub fn cudaRuntimeGetVersion(runtimeVersion: *mut ::libc::c_int) -> cudaError_t;
15291}
15292extern "C" {
15293 #[doc = " \\brief Creates a graph"]
15294 #[doc = ""]
15295 #[doc = " Creates an empty graph, which is returned via \\p pGraph."]
15296 #[doc = ""]
15297 #[doc = " \\param pGraph - Returns newly created graph"]
15298 #[doc = " \\param flags - Graph creation flags, must be 0"]
15299 #[doc = ""]
15300 #[doc = " \\return"]
15301 #[doc = " ::cudaSuccess,"]
15302 #[doc = " ::cudaErrorInvalidValue,"]
15303 #[doc = " ::cudaErrorMemoryAllocation"]
15304 #[doc = " \\note_graph_thread_safety"]
15305 #[doc = " \\notefnerr"]
15306 #[doc = " \\note_init_rt"]
15307 #[doc = " \\note_callback"]
15308 #[doc = ""]
15309 #[doc = " \\sa"]
15310 #[doc = " ::cudaGraphAddChildGraphNode,"]
15311 #[doc = " ::cudaGraphAddEmptyNode,"]
15312 #[doc = " ::cudaGraphAddKernelNode,"]
15313 #[doc = " ::cudaGraphAddHostNode,"]
15314 #[doc = " ::cudaGraphAddMemcpyNode,"]
15315 #[doc = " ::cudaGraphAddMemsetNode,"]
15316 #[doc = " ::cudaGraphInstantiate,"]
15317 #[doc = " ::cudaGraphDestroy,"]
15318 #[doc = " ::cudaGraphGetNodes,"]
15319 #[doc = " ::cudaGraphGetRootNodes,"]
15320 #[doc = " ::cudaGraphGetEdges,"]
15321 #[doc = " ::cudaGraphClone"]
15322 pub fn cudaGraphCreate(pGraph: *mut cudaGraph_t, flags: ::libc::c_uint) -> cudaError_t;
15323}
15324extern "C" {
15325 #[doc = " \\brief Creates a kernel execution node and adds it to a graph"]
15326 #[doc = ""]
15327 #[doc = " Creates a new kernel execution node and adds it to \\p graph with \\p numDependencies"]
15328 #[doc = " dependencies specified via \\p pDependencies and arguments specified in \\p pNodeParams."]
15329 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
15330 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
15331 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
15332 #[doc = ""]
15333 #[doc = " The cudaKernelNodeParams structure is defined as:"]
15334 #[doc = ""]
15335 #[doc = " \\code"]
15336 #[doc = " struct cudaKernelNodeParams"]
15337 #[doc = " {"]
15338 #[doc = " void* func;"]
15339 #[doc = " dim3 gridDim;"]
15340 #[doc = " dim3 blockDim;"]
15341 #[doc = " unsigned int sharedMemBytes;"]
15342 #[doc = " void **kernelParams;"]
15343 #[doc = " void **extra;"]
15344 #[doc = " };"]
15345 #[doc = " \\endcode"]
15346 #[doc = ""]
15347 #[doc = " When the graph is launched, the node will invoke kernel \\p func on a (\\p gridDim.x x"]
15348 #[doc = " \\p gridDim.y x \\p gridDim.z) grid of blocks. Each block contains"]
15349 #[doc = " (\\p blockDim.x x \\p blockDim.y x \\p blockDim.z) threads."]
15350 #[doc = ""]
15351 #[doc = " \\p sharedMem sets the amount of dynamic shared memory that will be"]
15352 #[doc = " available to each thread block."]
15353 #[doc = ""]
15354 #[doc = " Kernel parameters to \\p func can be specified in one of two ways:"]
15355 #[doc = ""]
15356 #[doc = " 1) Kernel parameters can be specified via \\p kernelParams. If the kernel has N"]
15357 #[doc = " parameters, then \\p kernelParams needs to be an array of N pointers. Each pointer,"]
15358 #[doc = " from \\p kernelParams[0] to \\p kernelParams[N-1], points to the region of memory from which the actual"]
15359 #[doc = " parameter will be copied. The number of kernel parameters and their offsets and sizes do not need"]
15360 #[doc = " to be specified as that information is retrieved directly from the kernel's image."]
15361 #[doc = ""]
15362 #[doc = " 2) Kernel parameters can also be packaged by the application into a single buffer that is passed in"]
15363 #[doc = " via \\p extra. This places the burden on the application of knowing each kernel"]
15364 #[doc = " parameter's size and alignment/padding within the buffer. The \\p extra parameter exists"]
15365 #[doc = " to allow this function to take additional less commonly used arguments. \\p extra specifies"]
15366 #[doc = " a list of names of extra settings and their corresponding values. Each extra setting name is"]
15367 #[doc = " immediately followed by the corresponding value. The list must be terminated with either NULL or"]
15368 #[doc = " CU_LAUNCH_PARAM_END."]
15369 #[doc = ""]
15370 #[doc = " - ::CU_LAUNCH_PARAM_END, which indicates the end of the \\p extra"]
15371 #[doc = " array;"]
15372 #[doc = " - ::CU_LAUNCH_PARAM_BUFFER_POINTER, which specifies that the next"]
15373 #[doc = " value in \\p extra will be a pointer to a buffer"]
15374 #[doc = " containing all the kernel parameters for launching kernel"]
15375 #[doc = " \\p func;"]
15376 #[doc = " - ::CU_LAUNCH_PARAM_BUFFER_SIZE, which specifies that the next"]
15377 #[doc = " value in \\p extra will be a pointer to a size_t"]
15378 #[doc = " containing the size of the buffer specified with"]
15379 #[doc = " ::CU_LAUNCH_PARAM_BUFFER_POINTER;"]
15380 #[doc = ""]
15381 #[doc = " The error ::cudaErrorInvalidValue will be returned if kernel parameters are specified with both"]
15382 #[doc = " \\p kernelParams and \\p extra (i.e. both \\p kernelParams and"]
15383 #[doc = " \\p extra are non-NULL)."]
15384 #[doc = ""]
15385 #[doc = " The \\p kernelParams or \\p extra array, as well as the argument values it points to,"]
15386 #[doc = " are copied during this call."]
15387 #[doc = ""]
15388 #[doc = " \\note Kernels launched using graphs must not use texture and surface references. Reading or"]
15389 #[doc = " writing through any texture or surface reference is undefined behavior."]
15390 #[doc = " This restriction does not apply to texture and surface objects."]
15391 #[doc = ""]
15392 #[doc = " \\param pGraphNode - Returns newly created node"]
15393 #[doc = " \\param graph - Graph to which to add the node"]
15394 #[doc = " \\param pDependencies - Dependencies of the node"]
15395 #[doc = " \\param numDependencies - Number of dependencies"]
15396 #[doc = " \\param pNodeParams - Parameters for the GPU execution node"]
15397 #[doc = ""]
15398 #[doc = " \\return"]
15399 #[doc = " ::cudaSuccess,"]
15400 #[doc = " ::cudaErrorInvalidValue,"]
15401 #[doc = " ::cudaErrorInvalidDeviceFunction"]
15402 #[doc = " \\note_graph_thread_safety"]
15403 #[doc = " \\notefnerr"]
15404 #[doc = " \\note_init_rt"]
15405 #[doc = " \\note_callback"]
15406 #[doc = ""]
15407 #[doc = " \\sa"]
15408 #[doc = " ::cudaLaunchKernel,"]
15409 #[doc = " ::cudaGraphKernelNodeGetParams,"]
15410 #[doc = " ::cudaGraphKernelNodeSetParams,"]
15411 #[doc = " ::cudaGraphCreate,"]
15412 #[doc = " ::cudaGraphDestroyNode,"]
15413 #[doc = " ::cudaGraphAddChildGraphNode,"]
15414 #[doc = " ::cudaGraphAddEmptyNode,"]
15415 #[doc = " ::cudaGraphAddHostNode,"]
15416 #[doc = " ::cudaGraphAddMemcpyNode,"]
15417 #[doc = " ::cudaGraphAddMemsetNode"]
15418 pub fn cudaGraphAddKernelNode(
15419 pGraphNode: *mut cudaGraphNode_t,
15420 graph: cudaGraph_t,
15421 pDependencies: *const cudaGraphNode_t,
15422 numDependencies: usize,
15423 pNodeParams: *const cudaKernelNodeParams,
15424 ) -> cudaError_t;
15425}
15426extern "C" {
15427 #[doc = " \\brief Returns a kernel node's parameters"]
15428 #[doc = ""]
15429 #[doc = " Returns the parameters of kernel node \\p node in \\p pNodeParams."]
15430 #[doc = " The \\p kernelParams or \\p extra array returned in \\p pNodeParams,"]
15431 #[doc = " as well as the argument values it points to, are owned by the node."]
15432 #[doc = " This memory remains valid until the node is destroyed or its"]
15433 #[doc = " parameters are modified, and should not be modified"]
15434 #[doc = " directly. Use ::cudaGraphKernelNodeSetParams to update the"]
15435 #[doc = " parameters of this node."]
15436 #[doc = ""]
15437 #[doc = " The params will contain either \\p kernelParams or \\p extra,"]
15438 #[doc = " according to which of these was most recently set on the node."]
15439 #[doc = ""]
15440 #[doc = " \\param node - Node to get the parameters for"]
15441 #[doc = " \\param pNodeParams - Pointer to return the parameters"]
15442 #[doc = ""]
15443 #[doc = " \\return"]
15444 #[doc = " ::cudaSuccess,"]
15445 #[doc = " ::cudaErrorInvalidValue,"]
15446 #[doc = " ::cudaErrorInvalidDeviceFunction"]
15447 #[doc = " \\note_graph_thread_safety"]
15448 #[doc = " \\notefnerr"]
15449 #[doc = " \\note_init_rt"]
15450 #[doc = " \\note_callback"]
15451 #[doc = ""]
15452 #[doc = " \\sa"]
15453 #[doc = " ::cudaLaunchKernel,"]
15454 #[doc = " ::cudaGraphAddKernelNode,"]
15455 #[doc = " ::cudaGraphKernelNodeSetParams"]
15456 pub fn cudaGraphKernelNodeGetParams(
15457 node: cudaGraphNode_t,
15458 pNodeParams: *mut cudaKernelNodeParams,
15459 ) -> cudaError_t;
15460}
15461extern "C" {
15462 #[doc = " \\brief Sets a kernel node's parameters"]
15463 #[doc = ""]
15464 #[doc = " Sets the parameters of kernel node \\p node to \\p pNodeParams."]
15465 #[doc = ""]
15466 #[doc = " \\param node - Node to set the parameters for"]
15467 #[doc = " \\param pNodeParams - Parameters to copy"]
15468 #[doc = ""]
15469 #[doc = " \\return"]
15470 #[doc = " ::cudaSuccess,"]
15471 #[doc = " ::cudaErrorInvalidValue,"]
15472 #[doc = " ::cudaErrorInvalidResourceHandle,"]
15473 #[doc = " ::cudaErrorMemoryAllocation"]
15474 #[doc = " \\note_graph_thread_safety"]
15475 #[doc = " \\notefnerr"]
15476 #[doc = " \\note_init_rt"]
15477 #[doc = " \\note_callback"]
15478 #[doc = ""]
15479 #[doc = " \\sa"]
15480 #[doc = " ::cudaLaunchKernel,"]
15481 #[doc = " ::cudaGraphAddKernelNode,"]
15482 #[doc = " ::cudaGraphKernelNodeGetParams"]
15483 pub fn cudaGraphKernelNodeSetParams(
15484 node: cudaGraphNode_t,
15485 pNodeParams: *const cudaKernelNodeParams,
15486 ) -> cudaError_t;
15487}
15488extern "C" {
15489 #[doc = " \\brief Copies attributes from source node to destination node."]
15490 #[doc = ""]
15491 #[doc = " Copies attributes from source node \\p src to destination node \\p dst."]
15492 #[doc = " Both node must have the same context."]
15493 #[doc = ""]
15494 #[doc = " \\param[out] dst Destination node"]
15495 #[doc = " \\param[in] src Source node"]
15496 #[doc = " For list of attributes see ::cudaKernelNodeAttrID"]
15497 #[doc = ""]
15498 #[doc = " \\return"]
15499 #[doc = " ::cudaSuccess,"]
15500 #[doc = " ::cudaErrorInvalidContext"]
15501 #[doc = " \\notefnerr"]
15502 #[doc = ""]
15503 #[doc = " \\sa"]
15504 #[doc = " ::cudaAccessPolicyWindow"]
15505 pub fn cudaGraphKernelNodeCopyAttributes(
15506 hSrc: cudaGraphNode_t,
15507 hDst: cudaGraphNode_t,
15508 ) -> cudaError_t;
15509}
15510extern "C" {
15511 #[doc = " \\brief Queries node attribute."]
15512 #[doc = ""]
15513 #[doc = " Queries attribute \\p attr from node \\p hNode and stores it in corresponding"]
15514 #[doc = " member of \\p value_out."]
15515 #[doc = ""]
15516 #[doc = " \\param[in] hNode"]
15517 #[doc = " \\param[in] attr"]
15518 #[doc = " \\param[out] value_out"]
15519 #[doc = ""]
15520 #[doc = " \\return"]
15521 #[doc = " ::cudaSuccess,"]
15522 #[doc = " ::cudaErrorInvalidValue,"]
15523 #[doc = " ::cudaErrorInvalidResourceHandle"]
15524 #[doc = " \\notefnerr"]
15525 #[doc = ""]
15526 #[doc = " \\sa"]
15527 #[doc = " ::cudaAccessPolicyWindow"]
15528 pub fn cudaGraphKernelNodeGetAttribute(
15529 hNode: cudaGraphNode_t,
15530 attr: cudaKernelNodeAttrID,
15531 value_out: *mut cudaKernelNodeAttrValue,
15532 ) -> cudaError_t;
15533}
15534extern "C" {
15535 #[doc = " \\brief Sets node attribute."]
15536 #[doc = ""]
15537 #[doc = " Sets attribute \\p attr on node \\p hNode from corresponding attribute of"]
15538 #[doc = " \\p value."]
15539 #[doc = ""]
15540 #[doc = " \\param[out] hNode"]
15541 #[doc = " \\param[in] attr"]
15542 #[doc = " \\param[out] value"]
15543 #[doc = ""]
15544 #[doc = " \\return"]
15545 #[doc = " ::cudaSuccess,"]
15546 #[doc = " ::cudaErrorInvalidValue,"]
15547 #[doc = " ::cudaErrorInvalidResourceHandle"]
15548 #[doc = " \\notefnerr"]
15549 #[doc = ""]
15550 #[doc = " \\sa"]
15551 #[doc = " ::cudaAccessPolicyWindow"]
15552 pub fn cudaGraphKernelNodeSetAttribute(
15553 hNode: cudaGraphNode_t,
15554 attr: cudaKernelNodeAttrID,
15555 value: *const cudaKernelNodeAttrValue,
15556 ) -> cudaError_t;
15557}
15558extern "C" {
15559 #[doc = " \\brief Creates a memcpy node and adds it to a graph"]
15560 #[doc = ""]
15561 #[doc = " Creates a new memcpy node and adds it to \\p graph with \\p numDependencies"]
15562 #[doc = " dependencies specified via \\p pDependencies."]
15563 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
15564 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
15565 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
15566 #[doc = ""]
15567 #[doc = " When the graph is launched, the node will perform the memcpy described by \\p pCopyParams."]
15568 #[doc = " See ::cudaMemcpy3D() for a description of the structure and its restrictions."]
15569 #[doc = ""]
15570 #[doc = " Memcpy nodes have some additional restrictions with regards to managed memory, if the"]
15571 #[doc = " system contains at least one device which has a zero value for the device attribute"]
15572 #[doc = " ::cudaDevAttrConcurrentManagedAccess."]
15573 #[doc = ""]
15574 #[doc = " \\param pGraphNode - Returns newly created node"]
15575 #[doc = " \\param graph - Graph to which to add the node"]
15576 #[doc = " \\param pDependencies - Dependencies of the node"]
15577 #[doc = " \\param numDependencies - Number of dependencies"]
15578 #[doc = " \\param pCopyParams - Parameters for the memory copy"]
15579 #[doc = ""]
15580 #[doc = " \\return"]
15581 #[doc = " ::cudaSuccess,"]
15582 #[doc = " ::cudaErrorInvalidValue"]
15583 #[doc = " \\note_graph_thread_safety"]
15584 #[doc = " \\notefnerr"]
15585 #[doc = " \\note_init_rt"]
15586 #[doc = " \\note_callback"]
15587 #[doc = ""]
15588 #[doc = " \\sa"]
15589 #[doc = " ::cudaMemcpy3D,"]
15590 #[doc = " ::cudaGraphAddMemcpyNodeToSymbol,"]
15591 #[doc = " ::cudaGraphAddMemcpyNodeFromSymbol,"]
15592 #[doc = " ::cudaGraphAddMemcpyNode1D,"]
15593 #[doc = " ::cudaGraphMemcpyNodeGetParams,"]
15594 #[doc = " ::cudaGraphMemcpyNodeSetParams,"]
15595 #[doc = " ::cudaGraphCreate,"]
15596 #[doc = " ::cudaGraphDestroyNode,"]
15597 #[doc = " ::cudaGraphAddChildGraphNode,"]
15598 #[doc = " ::cudaGraphAddEmptyNode,"]
15599 #[doc = " ::cudaGraphAddKernelNode,"]
15600 #[doc = " ::cudaGraphAddHostNode,"]
15601 #[doc = " ::cudaGraphAddMemsetNode"]
15602 pub fn cudaGraphAddMemcpyNode(
15603 pGraphNode: *mut cudaGraphNode_t,
15604 graph: cudaGraph_t,
15605 pDependencies: *const cudaGraphNode_t,
15606 numDependencies: usize,
15607 pCopyParams: *const cudaMemcpy3DParms,
15608 ) -> cudaError_t;
15609}
15610extern "C" {
15611 pub fn cudaGraphAddMemcpyNodeToSymbol(
15612 pGraphNode: *mut cudaGraphNode_t,
15613 graph: cudaGraph_t,
15614 pDependencies: *const cudaGraphNode_t,
15615 numDependencies: usize,
15616 symbol: *const ::libc::c_void,
15617 src: *const ::libc::c_void,
15618 count: usize,
15619 offset: usize,
15620 kind: cudaMemcpyKind,
15621 ) -> cudaError_t;
15622}
15623extern "C" {
15624 pub fn cudaGraphAddMemcpyNodeFromSymbol(
15625 pGraphNode: *mut cudaGraphNode_t,
15626 graph: cudaGraph_t,
15627 pDependencies: *const cudaGraphNode_t,
15628 numDependencies: usize,
15629 dst: *mut ::libc::c_void,
15630 symbol: *const ::libc::c_void,
15631 count: usize,
15632 offset: usize,
15633 kind: cudaMemcpyKind,
15634 ) -> cudaError_t;
15635}
15636extern "C" {
15637 pub fn cudaGraphAddMemcpyNode1D(
15638 pGraphNode: *mut cudaGraphNode_t,
15639 graph: cudaGraph_t,
15640 pDependencies: *const cudaGraphNode_t,
15641 numDependencies: usize,
15642 dst: *mut ::libc::c_void,
15643 src: *const ::libc::c_void,
15644 count: usize,
15645 kind: cudaMemcpyKind,
15646 ) -> cudaError_t;
15647}
15648extern "C" {
15649 #[doc = " \\brief Returns a memcpy node's parameters"]
15650 #[doc = ""]
15651 #[doc = " Returns the parameters of memcpy node \\p node in \\p pNodeParams."]
15652 #[doc = ""]
15653 #[doc = " \\param node - Node to get the parameters for"]
15654 #[doc = " \\param pNodeParams - Pointer to return the parameters"]
15655 #[doc = ""]
15656 #[doc = " \\return"]
15657 #[doc = " ::cudaSuccess,"]
15658 #[doc = " ::cudaErrorInvalidValue"]
15659 #[doc = " \\note_graph_thread_safety"]
15660 #[doc = " \\notefnerr"]
15661 #[doc = " \\note_init_rt"]
15662 #[doc = " \\note_callback"]
15663 #[doc = ""]
15664 #[doc = " \\sa"]
15665 #[doc = " ::cudaMemcpy3D,"]
15666 #[doc = " ::cudaGraphAddMemcpyNode,"]
15667 #[doc = " ::cudaGraphMemcpyNodeSetParams"]
15668 pub fn cudaGraphMemcpyNodeGetParams(
15669 node: cudaGraphNode_t,
15670 pNodeParams: *mut cudaMemcpy3DParms,
15671 ) -> cudaError_t;
15672}
15673extern "C" {
15674 #[doc = " \\brief Sets a memcpy node's parameters"]
15675 #[doc = ""]
15676 #[doc = " Sets the parameters of memcpy node \\p node to \\p pNodeParams."]
15677 #[doc = ""]
15678 #[doc = " \\param node - Node to set the parameters for"]
15679 #[doc = " \\param pNodeParams - Parameters to copy"]
15680 #[doc = ""]
15681 #[doc = " \\return"]
15682 #[doc = " ::cudaSuccess,"]
15683 #[doc = " ::cudaErrorInvalidValue,"]
15684 #[doc = " \\note_graph_thread_safety"]
15685 #[doc = " \\notefnerr"]
15686 #[doc = " \\note_init_rt"]
15687 #[doc = " \\note_callback"]
15688 #[doc = ""]
15689 #[doc = " \\sa"]
15690 #[doc = " ::cudaMemcpy3D,"]
15691 #[doc = " ::cudaGraphMemcpyNodeSetParamsToSymbol,"]
15692 #[doc = " ::cudaGraphMemcpyNodeSetParamsFromSymbol,"]
15693 #[doc = " ::cudaGraphMemcpyNodeSetParams1D,"]
15694 #[doc = " ::cudaGraphAddMemcpyNode,"]
15695 #[doc = " ::cudaGraphMemcpyNodeGetParams"]
15696 pub fn cudaGraphMemcpyNodeSetParams(
15697 node: cudaGraphNode_t,
15698 pNodeParams: *const cudaMemcpy3DParms,
15699 ) -> cudaError_t;
15700}
15701extern "C" {
15702 pub fn cudaGraphMemcpyNodeSetParamsToSymbol(
15703 node: cudaGraphNode_t,
15704 symbol: *const ::libc::c_void,
15705 src: *const ::libc::c_void,
15706 count: usize,
15707 offset: usize,
15708 kind: cudaMemcpyKind,
15709 ) -> cudaError_t;
15710}
15711extern "C" {
15712 pub fn cudaGraphMemcpyNodeSetParamsFromSymbol(
15713 node: cudaGraphNode_t,
15714 dst: *mut ::libc::c_void,
15715 symbol: *const ::libc::c_void,
15716 count: usize,
15717 offset: usize,
15718 kind: cudaMemcpyKind,
15719 ) -> cudaError_t;
15720}
15721extern "C" {
15722 pub fn cudaGraphMemcpyNodeSetParams1D(
15723 node: cudaGraphNode_t,
15724 dst: *mut ::libc::c_void,
15725 src: *const ::libc::c_void,
15726 count: usize,
15727 kind: cudaMemcpyKind,
15728 ) -> cudaError_t;
15729}
15730extern "C" {
15731 #[doc = " \\brief Creates a memset node and adds it to a graph"]
15732 #[doc = ""]
15733 #[doc = " Creates a new memset node and adds it to \\p graph with \\p numDependencies"]
15734 #[doc = " dependencies specified via \\p pDependencies."]
15735 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
15736 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
15737 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
15738 #[doc = ""]
15739 #[doc = " The element size must be 1, 2, or 4 bytes."]
15740 #[doc = " When the graph is launched, the node will perform the memset described by \\p pMemsetParams."]
15741 #[doc = ""]
15742 #[doc = " \\param pGraphNode - Returns newly created node"]
15743 #[doc = " \\param graph - Graph to which to add the node"]
15744 #[doc = " \\param pDependencies - Dependencies of the node"]
15745 #[doc = " \\param numDependencies - Number of dependencies"]
15746 #[doc = " \\param pMemsetParams - Parameters for the memory set"]
15747 #[doc = ""]
15748 #[doc = " \\return"]
15749 #[doc = " ::cudaSuccess,"]
15750 #[doc = " ::cudaErrorInvalidValue,"]
15751 #[doc = " ::cudaErrorInvalidDevice"]
15752 #[doc = " \\note_graph_thread_safety"]
15753 #[doc = " \\notefnerr"]
15754 #[doc = " \\note_init_rt"]
15755 #[doc = " \\note_callback"]
15756 #[doc = ""]
15757 #[doc = " \\sa"]
15758 #[doc = " ::cudaMemset2D,"]
15759 #[doc = " ::cudaGraphMemsetNodeGetParams,"]
15760 #[doc = " ::cudaGraphMemsetNodeSetParams,"]
15761 #[doc = " ::cudaGraphCreate,"]
15762 #[doc = " ::cudaGraphDestroyNode,"]
15763 #[doc = " ::cudaGraphAddChildGraphNode,"]
15764 #[doc = " ::cudaGraphAddEmptyNode,"]
15765 #[doc = " ::cudaGraphAddKernelNode,"]
15766 #[doc = " ::cudaGraphAddHostNode,"]
15767 #[doc = " ::cudaGraphAddMemcpyNode"]
15768 pub fn cudaGraphAddMemsetNode(
15769 pGraphNode: *mut cudaGraphNode_t,
15770 graph: cudaGraph_t,
15771 pDependencies: *const cudaGraphNode_t,
15772 numDependencies: usize,
15773 pMemsetParams: *const cudaMemsetParams,
15774 ) -> cudaError_t;
15775}
15776extern "C" {
15777 #[doc = " \\brief Returns a memset node's parameters"]
15778 #[doc = ""]
15779 #[doc = " Returns the parameters of memset node \\p node in \\p pNodeParams."]
15780 #[doc = ""]
15781 #[doc = " \\param node - Node to get the parameters for"]
15782 #[doc = " \\param pNodeParams - Pointer to return the parameters"]
15783 #[doc = ""]
15784 #[doc = " \\return"]
15785 #[doc = " ::cudaSuccess,"]
15786 #[doc = " ::cudaErrorInvalidValue"]
15787 #[doc = " \\note_graph_thread_safety"]
15788 #[doc = " \\notefnerr"]
15789 #[doc = " \\note_init_rt"]
15790 #[doc = " \\note_callback"]
15791 #[doc = ""]
15792 #[doc = " \\sa"]
15793 #[doc = " ::cudaMemset2D,"]
15794 #[doc = " ::cudaGraphAddMemsetNode,"]
15795 #[doc = " ::cudaGraphMemsetNodeSetParams"]
15796 pub fn cudaGraphMemsetNodeGetParams(
15797 node: cudaGraphNode_t,
15798 pNodeParams: *mut cudaMemsetParams,
15799 ) -> cudaError_t;
15800}
15801extern "C" {
15802 #[doc = " \\brief Sets a memset node's parameters"]
15803 #[doc = ""]
15804 #[doc = " Sets the parameters of memset node \\p node to \\p pNodeParams."]
15805 #[doc = ""]
15806 #[doc = " \\param node - Node to set the parameters for"]
15807 #[doc = " \\param pNodeParams - Parameters to copy"]
15808 #[doc = ""]
15809 #[doc = " \\return"]
15810 #[doc = " ::cudaSuccess,"]
15811 #[doc = " ::cudaErrorInvalidValue"]
15812 #[doc = " \\note_graph_thread_safety"]
15813 #[doc = " \\notefnerr"]
15814 #[doc = " \\note_init_rt"]
15815 #[doc = " \\note_callback"]
15816 #[doc = ""]
15817 #[doc = " \\sa"]
15818 #[doc = " ::cudaMemset2D,"]
15819 #[doc = " ::cudaGraphAddMemsetNode,"]
15820 #[doc = " ::cudaGraphMemsetNodeGetParams"]
15821 pub fn cudaGraphMemsetNodeSetParams(
15822 node: cudaGraphNode_t,
15823 pNodeParams: *const cudaMemsetParams,
15824 ) -> cudaError_t;
15825}
15826extern "C" {
15827 #[doc = " \\brief Creates a host execution node and adds it to a graph"]
15828 #[doc = ""]
15829 #[doc = " Creates a new CPU execution node and adds it to \\p graph with \\p numDependencies"]
15830 #[doc = " dependencies specified via \\p pDependencies and arguments specified in \\p pNodeParams."]
15831 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
15832 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
15833 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
15834 #[doc = ""]
15835 #[doc = " When the graph is launched, the node will invoke the specified CPU function."]
15836 #[doc = " Host nodes are not supported under MPS with pre-Volta GPUs."]
15837 #[doc = ""]
15838 #[doc = " \\param pGraphNode - Returns newly created node"]
15839 #[doc = " \\param graph - Graph to which to add the node"]
15840 #[doc = " \\param pDependencies - Dependencies of the node"]
15841 #[doc = " \\param numDependencies - Number of dependencies"]
15842 #[doc = " \\param pNodeParams - Parameters for the host node"]
15843 #[doc = ""]
15844 #[doc = " \\return"]
15845 #[doc = " ::cudaSuccess,"]
15846 #[doc = " ::cudaErrorNotSupported,"]
15847 #[doc = " ::cudaErrorInvalidValue"]
15848 #[doc = " \\note_graph_thread_safety"]
15849 #[doc = " \\notefnerr"]
15850 #[doc = " \\note_init_rt"]
15851 #[doc = " \\note_callback"]
15852 #[doc = ""]
15853 #[doc = " \\sa"]
15854 #[doc = " ::cudaLaunchHostFunc,"]
15855 #[doc = " ::cudaGraphHostNodeGetParams,"]
15856 #[doc = " ::cudaGraphHostNodeSetParams,"]
15857 #[doc = " ::cudaGraphCreate,"]
15858 #[doc = " ::cudaGraphDestroyNode,"]
15859 #[doc = " ::cudaGraphAddChildGraphNode,"]
15860 #[doc = " ::cudaGraphAddEmptyNode,"]
15861 #[doc = " ::cudaGraphAddKernelNode,"]
15862 #[doc = " ::cudaGraphAddMemcpyNode,"]
15863 #[doc = " ::cudaGraphAddMemsetNode"]
15864 pub fn cudaGraphAddHostNode(
15865 pGraphNode: *mut cudaGraphNode_t,
15866 graph: cudaGraph_t,
15867 pDependencies: *const cudaGraphNode_t,
15868 numDependencies: usize,
15869 pNodeParams: *const cudaHostNodeParams,
15870 ) -> cudaError_t;
15871}
15872extern "C" {
15873 #[doc = " \\brief Returns a host node's parameters"]
15874 #[doc = ""]
15875 #[doc = " Returns the parameters of host node \\p node in \\p pNodeParams."]
15876 #[doc = ""]
15877 #[doc = " \\param node - Node to get the parameters for"]
15878 #[doc = " \\param pNodeParams - Pointer to return the parameters"]
15879 #[doc = ""]
15880 #[doc = " \\return"]
15881 #[doc = " ::cudaSuccess,"]
15882 #[doc = " ::cudaErrorInvalidValue"]
15883 #[doc = " \\note_graph_thread_safety"]
15884 #[doc = " \\notefnerr"]
15885 #[doc = " \\note_init_rt"]
15886 #[doc = " \\note_callback"]
15887 #[doc = ""]
15888 #[doc = " \\sa"]
15889 #[doc = " ::cudaLaunchHostFunc,"]
15890 #[doc = " ::cudaGraphAddHostNode,"]
15891 #[doc = " ::cudaGraphHostNodeSetParams"]
15892 pub fn cudaGraphHostNodeGetParams(
15893 node: cudaGraphNode_t,
15894 pNodeParams: *mut cudaHostNodeParams,
15895 ) -> cudaError_t;
15896}
15897extern "C" {
15898 #[doc = " \\brief Sets a host node's parameters"]
15899 #[doc = ""]
15900 #[doc = " Sets the parameters of host node \\p node to \\p nodeParams."]
15901 #[doc = ""]
15902 #[doc = " \\param node - Node to set the parameters for"]
15903 #[doc = " \\param pNodeParams - Parameters to copy"]
15904 #[doc = ""]
15905 #[doc = " \\return"]
15906 #[doc = " ::cudaSuccess,"]
15907 #[doc = " ::cudaErrorInvalidValue"]
15908 #[doc = " \\note_graph_thread_safety"]
15909 #[doc = " \\notefnerr"]
15910 #[doc = " \\note_init_rt"]
15911 #[doc = " \\note_callback"]
15912 #[doc = ""]
15913 #[doc = " \\sa"]
15914 #[doc = " ::cudaLaunchHostFunc,"]
15915 #[doc = " ::cudaGraphAddHostNode,"]
15916 #[doc = " ::cudaGraphHostNodeGetParams"]
15917 pub fn cudaGraphHostNodeSetParams(
15918 node: cudaGraphNode_t,
15919 pNodeParams: *const cudaHostNodeParams,
15920 ) -> cudaError_t;
15921}
15922extern "C" {
15923 #[doc = " \\brief Creates a child graph node and adds it to a graph"]
15924 #[doc = ""]
15925 #[doc = " Creates a new node which executes an embedded graph, and adds it to \\p graph with"]
15926 #[doc = " \\p numDependencies dependencies specified via \\p pDependencies."]
15927 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
15928 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
15929 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
15930 #[doc = ""]
15931 #[doc = " If \\p hGraph contains allocation or free nodes, this call will return an error."]
15932 #[doc = ""]
15933 #[doc = " The node executes an embedded child graph. The child graph is cloned in this call."]
15934 #[doc = ""]
15935 #[doc = " \\param pGraphNode - Returns newly created node"]
15936 #[doc = " \\param graph - Graph to which to add the node"]
15937 #[doc = " \\param pDependencies - Dependencies of the node"]
15938 #[doc = " \\param numDependencies - Number of dependencies"]
15939 #[doc = " \\param childGraph - The graph to clone into this node"]
15940 #[doc = ""]
15941 #[doc = " \\return"]
15942 #[doc = " ::cudaSuccess,"]
15943 #[doc = " ::cudaErrorInvalidValue"]
15944 #[doc = " \\note_graph_thread_safety"]
15945 #[doc = " \\notefnerr"]
15946 #[doc = " \\note_init_rt"]
15947 #[doc = " \\note_callback"]
15948 #[doc = ""]
15949 #[doc = " \\sa"]
15950 #[doc = " ::cudaGraphChildGraphNodeGetGraph,"]
15951 #[doc = " ::cudaGraphCreate,"]
15952 #[doc = " ::cudaGraphDestroyNode,"]
15953 #[doc = " ::cudaGraphAddEmptyNode,"]
15954 #[doc = " ::cudaGraphAddKernelNode,"]
15955 #[doc = " ::cudaGraphAddHostNode,"]
15956 #[doc = " ::cudaGraphAddMemcpyNode,"]
15957 #[doc = " ::cudaGraphAddMemsetNode,"]
15958 #[doc = " ::cudaGraphClone"]
15959 pub fn cudaGraphAddChildGraphNode(
15960 pGraphNode: *mut cudaGraphNode_t,
15961 graph: cudaGraph_t,
15962 pDependencies: *const cudaGraphNode_t,
15963 numDependencies: usize,
15964 childGraph: cudaGraph_t,
15965 ) -> cudaError_t;
15966}
15967extern "C" {
15968 #[doc = " \\brief Gets a handle to the embedded graph of a child graph node"]
15969 #[doc = ""]
15970 #[doc = " Gets a handle to the embedded graph in a child graph node. This call"]
15971 #[doc = " does not clone the graph. Changes to the graph will be reflected in"]
15972 #[doc = " the node, and the node retains ownership of the graph."]
15973 #[doc = ""]
15974 #[doc = " Allocation and free nodes cannot be added to the returned graph."]
15975 #[doc = " Attempting to do so will return an error."]
15976 #[doc = ""]
15977 #[doc = " \\param node - Node to get the embedded graph for"]
15978 #[doc = " \\param pGraph - Location to store a handle to the graph"]
15979 #[doc = ""]
15980 #[doc = " \\return"]
15981 #[doc = " ::cudaSuccess,"]
15982 #[doc = " ::cudaErrorInvalidValue"]
15983 #[doc = " \\note_graph_thread_safety"]
15984 #[doc = " \\notefnerr"]
15985 #[doc = " \\note_init_rt"]
15986 #[doc = " \\note_callback"]
15987 #[doc = ""]
15988 #[doc = " \\sa"]
15989 #[doc = " ::cudaGraphAddChildGraphNode,"]
15990 #[doc = " ::cudaGraphNodeFindInClone"]
15991 pub fn cudaGraphChildGraphNodeGetGraph(
15992 node: cudaGraphNode_t,
15993 pGraph: *mut cudaGraph_t,
15994 ) -> cudaError_t;
15995}
15996extern "C" {
15997 #[doc = " \\brief Creates an empty node and adds it to a graph"]
15998 #[doc = ""]
15999 #[doc = " Creates a new node which performs no operation, and adds it to \\p graph with"]
16000 #[doc = " \\p numDependencies dependencies specified via \\p pDependencies."]
16001 #[doc = " It is possible for \\p numDependencies to be 0, in which case the node will be placed"]
16002 #[doc = " at the root of the graph. \\p pDependencies may not have any duplicate entries."]
16003 #[doc = " A handle to the new node will be returned in \\p pGraphNode."]
16004 #[doc = ""]
16005 #[doc = " An empty node performs no operation during execution, but can be used for"]
16006 #[doc = " transitive ordering. For example, a phased execution graph with 2 groups of n"]
16007 #[doc = " nodes with a barrier between them can be represented using an empty node and"]
16008 #[doc = " 2*n dependency edges, rather than no empty node and n^2 dependency edges."]
16009 #[doc = ""]
16010 #[doc = " \\param pGraphNode - Returns newly created node"]
16011 #[doc = " \\param graph - Graph to which to add the node"]
16012 #[doc = " \\param pDependencies - Dependencies of the node"]
16013 #[doc = " \\param numDependencies - Number of dependencies"]
16014 #[doc = ""]
16015 #[doc = " \\return"]
16016 #[doc = " ::cudaSuccess,"]
16017 #[doc = " ::cudaErrorInvalidValue"]
16018 #[doc = " \\note_graph_thread_safety"]
16019 #[doc = " \\note_init_rt"]
16020 #[doc = " \\note_callback"]
16021 #[doc = ""]
16022 #[doc = " \\sa"]
16023 #[doc = " ::cudaGraphCreate,"]
16024 #[doc = " ::cudaGraphDestroyNode,"]
16025 #[doc = " ::cudaGraphAddChildGraphNode,"]
16026 #[doc = " ::cudaGraphAddKernelNode,"]
16027 #[doc = " ::cudaGraphAddHostNode,"]
16028 #[doc = " ::cudaGraphAddMemcpyNode,"]
16029 #[doc = " ::cudaGraphAddMemsetNode"]
16030 pub fn cudaGraphAddEmptyNode(
16031 pGraphNode: *mut cudaGraphNode_t,
16032 graph: cudaGraph_t,
16033 pDependencies: *const cudaGraphNode_t,
16034 numDependencies: usize,
16035 ) -> cudaError_t;
16036}
16037extern "C" {
16038 pub fn cudaGraphAddEventRecordNode(
16039 pGraphNode: *mut cudaGraphNode_t,
16040 graph: cudaGraph_t,
16041 pDependencies: *const cudaGraphNode_t,
16042 numDependencies: usize,
16043 event: cudaEvent_t,
16044 ) -> cudaError_t;
16045}
16046extern "C" {
16047 pub fn cudaGraphEventRecordNodeGetEvent(
16048 node: cudaGraphNode_t,
16049 event_out: *mut cudaEvent_t,
16050 ) -> cudaError_t;
16051}
16052extern "C" {
16053 pub fn cudaGraphEventRecordNodeSetEvent(
16054 node: cudaGraphNode_t,
16055 event: cudaEvent_t,
16056 ) -> cudaError_t;
16057}
16058extern "C" {
16059 pub fn cudaGraphAddEventWaitNode(
16060 pGraphNode: *mut cudaGraphNode_t,
16061 graph: cudaGraph_t,
16062 pDependencies: *const cudaGraphNode_t,
16063 numDependencies: usize,
16064 event: cudaEvent_t,
16065 ) -> cudaError_t;
16066}
16067extern "C" {
16068 pub fn cudaGraphEventWaitNodeGetEvent(
16069 node: cudaGraphNode_t,
16070 event_out: *mut cudaEvent_t,
16071 ) -> cudaError_t;
16072}
16073extern "C" {
16074 pub fn cudaGraphEventWaitNodeSetEvent(node: cudaGraphNode_t, event: cudaEvent_t)
16075 -> cudaError_t;
16076}
16077extern "C" {
16078 pub fn cudaGraphAddExternalSemaphoresSignalNode(
16079 pGraphNode: *mut cudaGraphNode_t,
16080 graph: cudaGraph_t,
16081 pDependencies: *const cudaGraphNode_t,
16082 numDependencies: usize,
16083 nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
16084 ) -> cudaError_t;
16085}
16086extern "C" {
16087 pub fn cudaGraphExternalSemaphoresSignalNodeGetParams(
16088 hNode: cudaGraphNode_t,
16089 params_out: *mut cudaExternalSemaphoreSignalNodeParams,
16090 ) -> cudaError_t;
16091}
16092extern "C" {
16093 pub fn cudaGraphExternalSemaphoresSignalNodeSetParams(
16094 hNode: cudaGraphNode_t,
16095 nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
16096 ) -> cudaError_t;
16097}
16098extern "C" {
16099 pub fn cudaGraphAddExternalSemaphoresWaitNode(
16100 pGraphNode: *mut cudaGraphNode_t,
16101 graph: cudaGraph_t,
16102 pDependencies: *const cudaGraphNode_t,
16103 numDependencies: usize,
16104 nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
16105 ) -> cudaError_t;
16106}
16107extern "C" {
16108 pub fn cudaGraphExternalSemaphoresWaitNodeGetParams(
16109 hNode: cudaGraphNode_t,
16110 params_out: *mut cudaExternalSemaphoreWaitNodeParams,
16111 ) -> cudaError_t;
16112}
16113extern "C" {
16114 pub fn cudaGraphExternalSemaphoresWaitNodeSetParams(
16115 hNode: cudaGraphNode_t,
16116 nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
16117 ) -> cudaError_t;
16118}
16119extern "C" {
16120 pub fn cudaGraphAddMemAllocNode(
16121 pGraphNode: *mut cudaGraphNode_t,
16122 graph: cudaGraph_t,
16123 pDependencies: *const cudaGraphNode_t,
16124 numDependencies: usize,
16125 nodeParams: *mut cudaMemAllocNodeParams,
16126 ) -> cudaError_t;
16127}
16128extern "C" {
16129 pub fn cudaGraphMemAllocNodeGetParams(
16130 node: cudaGraphNode_t,
16131 params_out: *mut cudaMemAllocNodeParams,
16132 ) -> cudaError_t;
16133}
16134extern "C" {
16135 pub fn cudaGraphAddMemFreeNode(
16136 pGraphNode: *mut cudaGraphNode_t,
16137 graph: cudaGraph_t,
16138 pDependencies: *const cudaGraphNode_t,
16139 numDependencies: usize,
16140 dptr: *mut ::libc::c_void,
16141 ) -> cudaError_t;
16142}
16143extern "C" {
16144 pub fn cudaGraphMemFreeNodeGetParams(
16145 node: cudaGraphNode_t,
16146 dptr_out: *mut ::libc::c_void,
16147 ) -> cudaError_t;
16148}
16149extern "C" {
16150 pub fn cudaDeviceGraphMemTrim(device: ::libc::c_int) -> cudaError_t;
16151}
16152extern "C" {
16153 pub fn cudaDeviceGetGraphMemAttribute(
16154 device: ::libc::c_int,
16155 attr: cudaGraphMemAttributeType,
16156 value: *mut ::libc::c_void,
16157 ) -> cudaError_t;
16158}
16159extern "C" {
16160 pub fn cudaDeviceSetGraphMemAttribute(
16161 device: ::libc::c_int,
16162 attr: cudaGraphMemAttributeType,
16163 value: *mut ::libc::c_void,
16164 ) -> cudaError_t;
16165}
16166extern "C" {
16167 #[doc = " \\brief Clones a graph"]
16168 #[doc = ""]
16169 #[doc = " This function creates a copy of \\p originalGraph and returns it in \\p pGraphClone."]
16170 #[doc = " All parameters are copied into the cloned graph. The original graph may be modified"]
16171 #[doc = " after this call without affecting the clone."]
16172 #[doc = ""]
16173 #[doc = " Child graph nodes in the original graph are recursively copied into the clone."]
16174 #[doc = ""]
16175 #[doc = " \\param pGraphClone - Returns newly created cloned graph"]
16176 #[doc = " \\param originalGraph - Graph to clone"]
16177 #[doc = ""]
16178 #[doc = " \\return"]
16179 #[doc = " ::cudaSuccess,"]
16180 #[doc = " ::cudaErrorInvalidValue,"]
16181 #[doc = " ::cudaErrorMemoryAllocation"]
16182 #[doc = " \\note_graph_thread_safety"]
16183 #[doc = " \\notefnerr"]
16184 #[doc = " \\note_init_rt"]
16185 #[doc = " \\note_callback"]
16186 #[doc = ""]
16187 #[doc = " \\sa"]
16188 #[doc = " ::cudaGraphCreate,"]
16189 #[doc = " ::cudaGraphNodeFindInClone"]
16190 pub fn cudaGraphClone(pGraphClone: *mut cudaGraph_t, originalGraph: cudaGraph_t)
16191 -> cudaError_t;
16192}
16193extern "C" {
16194 #[doc = " \\brief Finds a cloned version of a node"]
16195 #[doc = ""]
16196 #[doc = " This function returns the node in \\p clonedGraph corresponding to \\p originalNode"]
16197 #[doc = " in the original graph."]
16198 #[doc = ""]
16199 #[doc = " \\p clonedGraph must have been cloned from \\p originalGraph via ::cudaGraphClone."]
16200 #[doc = " \\p originalNode must have been in \\p originalGraph at the time of the call to"]
16201 #[doc = " ::cudaGraphClone, and the corresponding cloned node in \\p clonedGraph must not have"]
16202 #[doc = " been removed. The cloned node is then returned via \\p pClonedNode."]
16203 #[doc = ""]
16204 #[doc = " \\param pNode - Returns handle to the cloned node"]
16205 #[doc = " \\param originalNode - Handle to the original node"]
16206 #[doc = " \\param clonedGraph - Cloned graph to query"]
16207 #[doc = ""]
16208 #[doc = " \\return"]
16209 #[doc = " ::cudaSuccess,"]
16210 #[doc = " ::cudaErrorInvalidValue"]
16211 #[doc = " \\note_graph_thread_safety"]
16212 #[doc = " \\notefnerr"]
16213 #[doc = " \\note_init_rt"]
16214 #[doc = " \\note_callback"]
16215 #[doc = ""]
16216 #[doc = " \\sa"]
16217 #[doc = " ::cudaGraphClone"]
16218 pub fn cudaGraphNodeFindInClone(
16219 pNode: *mut cudaGraphNode_t,
16220 originalNode: cudaGraphNode_t,
16221 clonedGraph: cudaGraph_t,
16222 ) -> cudaError_t;
16223}
16224extern "C" {
16225 #[doc = " \\brief Returns a node's type"]
16226 #[doc = ""]
16227 #[doc = " Returns the node type of \\p node in \\p pType."]
16228 #[doc = ""]
16229 #[doc = " \\param node - Node to query"]
16230 #[doc = " \\param pType - Pointer to return the node type"]
16231 #[doc = ""]
16232 #[doc = " \\return"]
16233 #[doc = " ::cudaSuccess,"]
16234 #[doc = " ::cudaErrorInvalidValue"]
16235 #[doc = " \\note_graph_thread_safety"]
16236 #[doc = " \\notefnerr"]
16237 #[doc = " \\note_init_rt"]
16238 #[doc = " \\note_callback"]
16239 #[doc = ""]
16240 #[doc = " \\sa"]
16241 #[doc = " ::cudaGraphGetNodes,"]
16242 #[doc = " ::cudaGraphGetRootNodes,"]
16243 #[doc = " ::cudaGraphChildGraphNodeGetGraph,"]
16244 #[doc = " ::cudaGraphKernelNodeGetParams,"]
16245 #[doc = " ::cudaGraphKernelNodeSetParams,"]
16246 #[doc = " ::cudaGraphHostNodeGetParams,"]
16247 #[doc = " ::cudaGraphHostNodeSetParams,"]
16248 #[doc = " ::cudaGraphMemcpyNodeGetParams,"]
16249 #[doc = " ::cudaGraphMemcpyNodeSetParams,"]
16250 #[doc = " ::cudaGraphMemsetNodeGetParams,"]
16251 #[doc = " ::cudaGraphMemsetNodeSetParams"]
16252 pub fn cudaGraphNodeGetType(
16253 node: cudaGraphNode_t,
16254 pType: *mut cudaGraphNodeType,
16255 ) -> cudaError_t;
16256}
16257extern "C" {
16258 #[doc = " \\brief Returns a graph's nodes"]
16259 #[doc = ""]
16260 #[doc = " Returns a list of \\p graph's nodes. \\p nodes may be NULL, in which case this"]
16261 #[doc = " function will return the number of nodes in \\p numNodes. Otherwise,"]
16262 #[doc = " \\p numNodes entries will be filled in. If \\p numNodes is higher than the actual"]
16263 #[doc = " number of nodes, the remaining entries in \\p nodes will be set to NULL, and the"]
16264 #[doc = " number of nodes actually obtained will be returned in \\p numNodes."]
16265 #[doc = ""]
16266 #[doc = " \\param graph - Graph to query"]
16267 #[doc = " \\param nodes - Pointer to return the nodes"]
16268 #[doc = " \\param numNodes - See description"]
16269 #[doc = ""]
16270 #[doc = " \\return"]
16271 #[doc = " ::cudaSuccess,"]
16272 #[doc = " ::cudaErrorInvalidValue"]
16273 #[doc = " \\note_graph_thread_safety"]
16274 #[doc = " \\notefnerr"]
16275 #[doc = " \\note_init_rt"]
16276 #[doc = " \\note_callback"]
16277 #[doc = ""]
16278 #[doc = " \\sa"]
16279 #[doc = " ::cudaGraphCreate,"]
16280 #[doc = " ::cudaGraphGetRootNodes,"]
16281 #[doc = " ::cudaGraphGetEdges,"]
16282 #[doc = " ::cudaGraphNodeGetType,"]
16283 #[doc = " ::cudaGraphNodeGetDependencies,"]
16284 #[doc = " ::cudaGraphNodeGetDependentNodes"]
16285 pub fn cudaGraphGetNodes(
16286 graph: cudaGraph_t,
16287 nodes: *mut cudaGraphNode_t,
16288 numNodes: *mut usize,
16289 ) -> cudaError_t;
16290}
16291extern "C" {
16292 #[doc = " \\brief Returns a graph's root nodes"]
16293 #[doc = ""]
16294 #[doc = " Returns a list of \\p graph's root nodes. \\p pRootNodes may be NULL, in which case this"]
16295 #[doc = " function will return the number of root nodes in \\p pNumRootNodes. Otherwise,"]
16296 #[doc = " \\p pNumRootNodes entries will be filled in. If \\p pNumRootNodes is higher than the actual"]
16297 #[doc = " number of root nodes, the remaining entries in \\p pRootNodes will be set to NULL, and the"]
16298 #[doc = " number of nodes actually obtained will be returned in \\p pNumRootNodes."]
16299 #[doc = ""]
16300 #[doc = " \\param graph - Graph to query"]
16301 #[doc = " \\param pRootNodes - Pointer to return the root nodes"]
16302 #[doc = " \\param pNumRootNodes - See description"]
16303 #[doc = ""]
16304 #[doc = " \\return"]
16305 #[doc = " ::cudaSuccess,"]
16306 #[doc = " ::cudaErrorInvalidValue"]
16307 #[doc = " \\note_graph_thread_safety"]
16308 #[doc = " \\notefnerr"]
16309 #[doc = " \\note_init_rt"]
16310 #[doc = " \\note_callback"]
16311 #[doc = ""]
16312 #[doc = " \\sa"]
16313 #[doc = " ::cudaGraphCreate,"]
16314 #[doc = " ::cudaGraphGetNodes,"]
16315 #[doc = " ::cudaGraphGetEdges,"]
16316 #[doc = " ::cudaGraphNodeGetType,"]
16317 #[doc = " ::cudaGraphNodeGetDependencies,"]
16318 #[doc = " ::cudaGraphNodeGetDependentNodes"]
16319 pub fn cudaGraphGetRootNodes(
16320 graph: cudaGraph_t,
16321 pRootNodes: *mut cudaGraphNode_t,
16322 pNumRootNodes: *mut usize,
16323 ) -> cudaError_t;
16324}
16325extern "C" {
16326 #[doc = " \\brief Returns a graph's dependency edges"]
16327 #[doc = ""]
16328 #[doc = " Returns a list of \\p graph's dependency edges. Edges are returned via corresponding"]
16329 #[doc = " indices in \\p from and \\p to; that is, the node in \\p to[i] has a dependency on the"]
16330 #[doc = " node in \\p from[i]. \\p from and \\p to may both be NULL, in which"]
16331 #[doc = " case this function only returns the number of edges in \\p numEdges. Otherwise,"]
16332 #[doc = " \\p numEdges entries will be filled in. If \\p numEdges is higher than the actual"]
16333 #[doc = " number of edges, the remaining entries in \\p from and \\p to will be set to NULL, and"]
16334 #[doc = " the number of edges actually returned will be written to \\p numEdges."]
16335 #[doc = ""]
16336 #[doc = " \\param graph - Graph to get the edges from"]
16337 #[doc = " \\param from - Location to return edge endpoints"]
16338 #[doc = " \\param to - Location to return edge endpoints"]
16339 #[doc = " \\param numEdges - See description"]
16340 #[doc = ""]
16341 #[doc = " \\return"]
16342 #[doc = " ::cudaSuccess,"]
16343 #[doc = " ::cudaErrorInvalidValue"]
16344 #[doc = " \\note_graph_thread_safety"]
16345 #[doc = " \\notefnerr"]
16346 #[doc = " \\note_init_rt"]
16347 #[doc = " \\note_callback"]
16348 #[doc = ""]
16349 #[doc = " \\sa"]
16350 #[doc = " ::cudaGraphGetNodes,"]
16351 #[doc = " ::cudaGraphGetRootNodes,"]
16352 #[doc = " ::cudaGraphAddDependencies,"]
16353 #[doc = " ::cudaGraphRemoveDependencies,"]
16354 #[doc = " ::cudaGraphNodeGetDependencies,"]
16355 #[doc = " ::cudaGraphNodeGetDependentNodes"]
16356 pub fn cudaGraphGetEdges(
16357 graph: cudaGraph_t,
16358 from: *mut cudaGraphNode_t,
16359 to: *mut cudaGraphNode_t,
16360 numEdges: *mut usize,
16361 ) -> cudaError_t;
16362}
16363extern "C" {
16364 #[doc = " \\brief Returns a node's dependencies"]
16365 #[doc = ""]
16366 #[doc = " Returns a list of \\p node's dependencies. \\p pDependencies may be NULL, in which case this"]
16367 #[doc = " function will return the number of dependencies in \\p pNumDependencies. Otherwise,"]
16368 #[doc = " \\p pNumDependencies entries will be filled in. If \\p pNumDependencies is higher than the actual"]
16369 #[doc = " number of dependencies, the remaining entries in \\p pDependencies will be set to NULL, and the"]
16370 #[doc = " number of nodes actually obtained will be returned in \\p pNumDependencies."]
16371 #[doc = ""]
16372 #[doc = " \\param node - Node to query"]
16373 #[doc = " \\param pDependencies - Pointer to return the dependencies"]
16374 #[doc = " \\param pNumDependencies - See description"]
16375 #[doc = ""]
16376 #[doc = " \\return"]
16377 #[doc = " ::cudaSuccess,"]
16378 #[doc = " ::cudaErrorInvalidValue"]
16379 #[doc = " \\note_graph_thread_safety"]
16380 #[doc = " \\notefnerr"]
16381 #[doc = " \\note_init_rt"]
16382 #[doc = " \\note_callback"]
16383 #[doc = ""]
16384 #[doc = " \\sa"]
16385 #[doc = " ::cudaGraphNodeGetDependentNodes,"]
16386 #[doc = " ::cudaGraphGetNodes,"]
16387 #[doc = " ::cudaGraphGetRootNodes,"]
16388 #[doc = " ::cudaGraphGetEdges,"]
16389 #[doc = " ::cudaGraphAddDependencies,"]
16390 #[doc = " ::cudaGraphRemoveDependencies"]
16391 pub fn cudaGraphNodeGetDependencies(
16392 node: cudaGraphNode_t,
16393 pDependencies: *mut cudaGraphNode_t,
16394 pNumDependencies: *mut usize,
16395 ) -> cudaError_t;
16396}
16397extern "C" {
16398 #[doc = " \\brief Returns a node's dependent nodes"]
16399 #[doc = ""]
16400 #[doc = " Returns a list of \\p node's dependent nodes. \\p pDependentNodes may be NULL, in which"]
16401 #[doc = " case this function will return the number of dependent nodes in \\p pNumDependentNodes."]
16402 #[doc = " Otherwise, \\p pNumDependentNodes entries will be filled in. If \\p pNumDependentNodes is"]
16403 #[doc = " higher than the actual number of dependent nodes, the remaining entries in"]
16404 #[doc = " \\p pDependentNodes will be set to NULL, and the number of nodes actually obtained will"]
16405 #[doc = " be returned in \\p pNumDependentNodes."]
16406 #[doc = ""]
16407 #[doc = " \\param node - Node to query"]
16408 #[doc = " \\param pDependentNodes - Pointer to return the dependent nodes"]
16409 #[doc = " \\param pNumDependentNodes - See description"]
16410 #[doc = ""]
16411 #[doc = " \\return"]
16412 #[doc = " ::cudaSuccess,"]
16413 #[doc = " ::cudaErrorInvalidValue"]
16414 #[doc = " \\note_graph_thread_safety"]
16415 #[doc = " \\notefnerr"]
16416 #[doc = " \\note_init_rt"]
16417 #[doc = " \\note_callback"]
16418 #[doc = ""]
16419 #[doc = " \\sa"]
16420 #[doc = " ::cudaGraphNodeGetDependencies,"]
16421 #[doc = " ::cudaGraphGetNodes,"]
16422 #[doc = " ::cudaGraphGetRootNodes,"]
16423 #[doc = " ::cudaGraphGetEdges,"]
16424 #[doc = " ::cudaGraphAddDependencies,"]
16425 #[doc = " ::cudaGraphRemoveDependencies"]
16426 pub fn cudaGraphNodeGetDependentNodes(
16427 node: cudaGraphNode_t,
16428 pDependentNodes: *mut cudaGraphNode_t,
16429 pNumDependentNodes: *mut usize,
16430 ) -> cudaError_t;
16431}
16432extern "C" {
16433 #[doc = " \\brief Adds dependency edges to a graph."]
16434 #[doc = ""]
16435 #[doc = " The number of dependencies to be added is defined by \\p numDependencies"]
16436 #[doc = " Elements in \\p pFrom and \\p pTo at corresponding indices define a dependency."]
16437 #[doc = " Each node in \\p pFrom and \\p pTo must belong to \\p graph."]
16438 #[doc = ""]
16439 #[doc = " If \\p numDependencies is 0, elements in \\p pFrom and \\p pTo will be ignored."]
16440 #[doc = " Specifying an existing dependency will return an error."]
16441 #[doc = ""]
16442 #[doc = " \\param graph - Graph to which dependencies are added"]
16443 #[doc = " \\param from - Array of nodes that provide the dependencies"]
16444 #[doc = " \\param to - Array of dependent nodes"]
16445 #[doc = " \\param numDependencies - Number of dependencies to be added"]
16446 #[doc = ""]
16447 #[doc = " \\return"]
16448 #[doc = " ::cudaSuccess,"]
16449 #[doc = " ::cudaErrorInvalidValue"]
16450 #[doc = " \\note_graph_thread_safety"]
16451 #[doc = " \\notefnerr"]
16452 #[doc = " \\note_init_rt"]
16453 #[doc = " \\note_callback"]
16454 #[doc = ""]
16455 #[doc = " \\sa"]
16456 #[doc = " ::cudaGraphRemoveDependencies,"]
16457 #[doc = " ::cudaGraphGetEdges,"]
16458 #[doc = " ::cudaGraphNodeGetDependencies,"]
16459 #[doc = " ::cudaGraphNodeGetDependentNodes"]
16460 pub fn cudaGraphAddDependencies(
16461 graph: cudaGraph_t,
16462 from: *const cudaGraphNode_t,
16463 to: *const cudaGraphNode_t,
16464 numDependencies: usize,
16465 ) -> cudaError_t;
16466}
16467extern "C" {
16468 #[doc = " \\brief Removes dependency edges from a graph."]
16469 #[doc = ""]
16470 #[doc = " The number of \\p pDependencies to be removed is defined by \\p numDependencies."]
16471 #[doc = " Elements in \\p pFrom and \\p pTo at corresponding indices define a dependency."]
16472 #[doc = " Each node in \\p pFrom and \\p pTo must belong to \\p graph."]
16473 #[doc = ""]
16474 #[doc = " If \\p numDependencies is 0, elements in \\p pFrom and \\p pTo will be ignored."]
16475 #[doc = " Specifying a non-existing dependency will return an error."]
16476 #[doc = ""]
16477 #[doc = " \\param graph - Graph from which to remove dependencies"]
16478 #[doc = " \\param from - Array of nodes that provide the dependencies"]
16479 #[doc = " \\param to - Array of dependent nodes"]
16480 #[doc = " \\param numDependencies - Number of dependencies to be removed"]
16481 #[doc = ""]
16482 #[doc = " \\return"]
16483 #[doc = " ::cudaSuccess,"]
16484 #[doc = " ::cudaErrorInvalidValue"]
16485 #[doc = " \\note_graph_thread_safety"]
16486 #[doc = " \\notefnerr"]
16487 #[doc = " \\note_init_rt"]
16488 #[doc = " \\note_callback"]
16489 #[doc = ""]
16490 #[doc = " \\sa"]
16491 #[doc = " ::cudaGraphAddDependencies,"]
16492 #[doc = " ::cudaGraphGetEdges,"]
16493 #[doc = " ::cudaGraphNodeGetDependencies,"]
16494 #[doc = " ::cudaGraphNodeGetDependentNodes"]
16495 pub fn cudaGraphRemoveDependencies(
16496 graph: cudaGraph_t,
16497 from: *const cudaGraphNode_t,
16498 to: *const cudaGraphNode_t,
16499 numDependencies: usize,
16500 ) -> cudaError_t;
16501}
16502extern "C" {
16503 #[doc = " \\brief Remove a node from the graph"]
16504 #[doc = ""]
16505 #[doc = " Removes \\p node from its graph. This operation also severs any dependencies of other nodes"]
16506 #[doc = " on \\p node and vice versa."]
16507 #[doc = ""]
16508 #[doc = " Dependencies cannot be removed from graphs which contain allocation or free nodes."]
16509 #[doc = " Any attempt to do so will return an error."]
16510 #[doc = ""]
16511 #[doc = " \\param node - Node to remove"]
16512 #[doc = ""]
16513 #[doc = " \\return"]
16514 #[doc = " ::cudaSuccess,"]
16515 #[doc = " ::cudaErrorInvalidValue"]
16516 #[doc = " \\note_graph_thread_safety"]
16517 #[doc = " \\notefnerr"]
16518 #[doc = " \\note_init_rt"]
16519 #[doc = " \\note_callback"]
16520 #[doc = " \\note_destroy_ub"]
16521 #[doc = ""]
16522 #[doc = " \\sa"]
16523 #[doc = " ::cudaGraphAddChildGraphNode,"]
16524 #[doc = " ::cudaGraphAddEmptyNode,"]
16525 #[doc = " ::cudaGraphAddKernelNode,"]
16526 #[doc = " ::cudaGraphAddHostNode,"]
16527 #[doc = " ::cudaGraphAddMemcpyNode,"]
16528 #[doc = " ::cudaGraphAddMemsetNode"]
16529 pub fn cudaGraphDestroyNode(node: cudaGraphNode_t) -> cudaError_t;
16530}
16531extern "C" {
16532 #[doc = " \\brief Creates an executable graph from a graph"]
16533 #[doc = ""]
16534 #[doc = " Instantiates \\p graph as an executable graph. The graph is validated for any"]
16535 #[doc = " structural constraints or intra-node constraints which were not previously"]
16536 #[doc = " validated. If instantiation is successful, a handle to the instantiated graph"]
16537 #[doc = " is returned in \\p pGraphExec."]
16538 #[doc = ""]
16539 #[doc = " If there are any errors, diagnostic information may be returned in \\p pErrorNode and"]
16540 #[doc = " \\p pLogBuffer. This is the primary way to inspect instantiation errors. The output"]
16541 #[doc = " will be null terminated unless the diagnostics overflow"]
16542 #[doc = " the buffer. In this case, they will be truncated, and the last byte can be"]
16543 #[doc = " inspected to determine if truncation occurred."]
16544 #[doc = ""]
16545 #[doc = " \\param pGraphExec - Returns instantiated graph"]
16546 #[doc = " \\param graph - Graph to instantiate"]
16547 #[doc = " \\param pErrorNode - In case of an instantiation error, this may be modified to"]
16548 #[doc = " indicate a node contributing to the error"]
16549 #[doc = " \\param pLogBuffer - A character buffer to store diagnostic messages"]
16550 #[doc = " \\param bufferSize - Size of the log buffer in bytes"]
16551 #[doc = ""]
16552 #[doc = " \\return"]
16553 #[doc = " ::cudaSuccess,"]
16554 #[doc = " ::cudaErrorInvalidValue"]
16555 #[doc = " \\note_graph_thread_safety"]
16556 #[doc = " \\notefnerr"]
16557 #[doc = " \\note_init_rt"]
16558 #[doc = " \\note_callback"]
16559 #[doc = ""]
16560 #[doc = " \\sa"]
16561 #[doc = " ::cudaGraphInstantiateWithFlags,"]
16562 #[doc = " ::cudaGraphCreate,"]
16563 #[doc = " ::cudaGraphUpload,"]
16564 #[doc = " ::cudaGraphLaunch,"]
16565 #[doc = " ::cudaGraphExecDestroy"]
16566 pub fn cudaGraphInstantiate(
16567 pGraphExec: *mut cudaGraphExec_t,
16568 graph: cudaGraph_t,
16569 pErrorNode: *mut cudaGraphNode_t,
16570 pLogBuffer: *mut ::libc::c_char,
16571 bufferSize: usize,
16572 ) -> cudaError_t;
16573}
16574extern "C" {
16575 pub fn cudaGraphInstantiateWithFlags(
16576 pGraphExec: *mut cudaGraphExec_t,
16577 graph: cudaGraph_t,
16578 flags: ::libc::c_ulonglong,
16579 ) -> cudaError_t;
16580}
16581extern "C" {
16582 #[doc = " \\brief Sets the parameters for a kernel node in the given graphExec"]
16583 #[doc = ""]
16584 #[doc = " Sets the parameters of a kernel node in an executable graph \\p hGraphExec."]
16585 #[doc = " The node is identified by the corresponding node \\p node in the"]
16586 #[doc = " non-executable graph, from which the executable graph was instantiated."]
16587 #[doc = ""]
16588 #[doc = " \\p node must not have been removed from the original graph. The \\p func field"]
16589 #[doc = " of \\p nodeParams cannot be modified and must match the original value."]
16590 #[doc = " All other values can be modified."]
16591 #[doc = ""]
16592 #[doc = " The modifications only affect future launches of \\p hGraphExec. Already"]
16593 #[doc = " enqueued or running launches of \\p hGraphExec are not affected by this call."]
16594 #[doc = " \\p node is also not modified by this call."]
16595 #[doc = ""]
16596 #[doc = " \\param hGraphExec - The executable graph in which to set the specified node"]
16597 #[doc = " \\param node - kernel node from the graph from which graphExec was instantiated"]
16598 #[doc = " \\param pNodeParams - Updated Parameters to set"]
16599 #[doc = ""]
16600 #[doc = " \\return"]
16601 #[doc = " ::cudaSuccess,"]
16602 #[doc = " ::cudaErrorInvalidValue,"]
16603 #[doc = " \\note_graph_thread_safety"]
16604 #[doc = " \\notefnerr"]
16605 #[doc = " \\note_init_rt"]
16606 #[doc = " \\note_callback"]
16607 #[doc = ""]
16608 #[doc = " \\sa"]
16609 #[doc = " ::cudaGraphAddKernelNode,"]
16610 #[doc = " ::cudaGraphKernelNodeSetParams,"]
16611 #[doc = " ::cudaGraphExecMemcpyNodeSetParams,"]
16612 #[doc = " ::cudaGraphExecMemsetNodeSetParams,"]
16613 #[doc = " ::cudaGraphExecHostNodeSetParams,"]
16614 #[doc = " ::cudaGraphExecChildGraphNodeSetParams,"]
16615 #[doc = " ::cudaGraphExecEventRecordNodeSetEvent,"]
16616 #[doc = " ::cudaGraphExecEventWaitNodeSetEvent,"]
16617 #[doc = " ::cudaGraphExecExternalSemaphoresSignalNodeSetParams,"]
16618 #[doc = " ::cudaGraphExecExternalSemaphoresWaitNodeSetParams,"]
16619 #[doc = " ::cudaGraphExecUpdate,"]
16620 #[doc = " ::cudaGraphInstantiate"]
16621 pub fn cudaGraphExecKernelNodeSetParams(
16622 hGraphExec: cudaGraphExec_t,
16623 node: cudaGraphNode_t,
16624 pNodeParams: *const cudaKernelNodeParams,
16625 ) -> cudaError_t;
16626}
16627extern "C" {
16628 #[doc = " \\brief Sets the parameters for a memcpy node in the given graphExec."]
16629 #[doc = ""]
16630 #[doc = " Updates the work represented by \\p node in \\p hGraphExec as though \\p node had"]
16631 #[doc = " contained \\p pNodeParams at instantiation. \\p node must remain in the graph which was"]
16632 #[doc = " used to instantiate \\p hGraphExec. Changed edges to and from \\p node are ignored."]
16633 #[doc = ""]
16634 #[doc = " The source and destination memory in \\p pNodeParams must be allocated from the same"]
16635 #[doc = " contexts as the original source and destination memory. Both the instantiation-time"]
16636 #[doc = " memory operands and the memory operands in \\p pNodeParams must be 1-dimensional."]
16637 #[doc = " Zero-length operations are not supported."]
16638 #[doc = ""]
16639 #[doc = " The modifications only affect future launches of \\p hGraphExec. Already enqueued"]
16640 #[doc = " or running launches of \\p hGraphExec are not affected by this call. \\p node is also"]
16641 #[doc = " not modified by this call."]
16642 #[doc = ""]
16643 #[doc = " Returns ::cudaErrorInvalidValue if the memory operands' mappings changed or"]
16644 #[doc = " either the original or new memory operands are multidimensional."]
16645 #[doc = ""]
16646 #[doc = " \\param hGraphExec - The executable graph in which to set the specified node"]
16647 #[doc = " \\param node - Memcpy node from the graph which was used to instantiate graphExec"]
16648 #[doc = " \\param pNodeParams - Updated Parameters to set"]
16649 #[doc = ""]
16650 #[doc = " \\return"]
16651 #[doc = " ::cudaSuccess,"]
16652 #[doc = " ::cudaErrorInvalidValue,"]
16653 #[doc = " \\note_graph_thread_safety"]
16654 #[doc = " \\notefnerr"]
16655 #[doc = " \\note_init_rt"]
16656 #[doc = " \\note_callback"]
16657 #[doc = ""]
16658 #[doc = " \\sa"]
16659 #[doc = " ::cudaGraphAddMemcpyNode,"]
16660 #[doc = " ::cudaGraphMemcpyNodeSetParams,"]
16661 #[doc = " ::cudaGraphExecMemcpyNodeSetParamsToSymbol,"]
16662 #[doc = " ::cudaGraphExecMemcpyNodeSetParamsFromSymbol,"]
16663 #[doc = " ::cudaGraphExecMemcpyNodeSetParams1D,"]
16664 #[doc = " ::cudaGraphExecKernelNodeSetParams,"]
16665 #[doc = " ::cudaGraphExecMemsetNodeSetParams,"]
16666 #[doc = " ::cudaGraphExecHostNodeSetParams,"]
16667 #[doc = " ::cudaGraphExecChildGraphNodeSetParams,"]
16668 #[doc = " ::cudaGraphExecEventRecordNodeSetEvent,"]
16669 #[doc = " ::cudaGraphExecEventWaitNodeSetEvent,"]
16670 #[doc = " ::cudaGraphExecExternalSemaphoresSignalNodeSetParams,"]
16671 #[doc = " ::cudaGraphExecExternalSemaphoresWaitNodeSetParams,"]
16672 #[doc = " ::cudaGraphExecUpdate,"]
16673 #[doc = " ::cudaGraphInstantiate"]
16674 pub fn cudaGraphExecMemcpyNodeSetParams(
16675 hGraphExec: cudaGraphExec_t,
16676 node: cudaGraphNode_t,
16677 pNodeParams: *const cudaMemcpy3DParms,
16678 ) -> cudaError_t;
16679}
16680extern "C" {
16681 pub fn cudaGraphExecMemcpyNodeSetParamsToSymbol(
16682 hGraphExec: cudaGraphExec_t,
16683 node: cudaGraphNode_t,
16684 symbol: *const ::libc::c_void,
16685 src: *const ::libc::c_void,
16686 count: usize,
16687 offset: usize,
16688 kind: cudaMemcpyKind,
16689 ) -> cudaError_t;
16690}
16691extern "C" {
16692 pub fn cudaGraphExecMemcpyNodeSetParamsFromSymbol(
16693 hGraphExec: cudaGraphExec_t,
16694 node: cudaGraphNode_t,
16695 dst: *mut ::libc::c_void,
16696 symbol: *const ::libc::c_void,
16697 count: usize,
16698 offset: usize,
16699 kind: cudaMemcpyKind,
16700 ) -> cudaError_t;
16701}
16702extern "C" {
16703 pub fn cudaGraphExecMemcpyNodeSetParams1D(
16704 hGraphExec: cudaGraphExec_t,
16705 node: cudaGraphNode_t,
16706 dst: *mut ::libc::c_void,
16707 src: *const ::libc::c_void,
16708 count: usize,
16709 kind: cudaMemcpyKind,
16710 ) -> cudaError_t;
16711}
16712extern "C" {
16713 #[doc = " \\brief Sets the parameters for a memset node in the given graphExec."]
16714 #[doc = ""]
16715 #[doc = " Updates the work represented by \\p node in \\p hGraphExec as though \\p node had"]
16716 #[doc = " contained \\p pNodeParams at instantiation. \\p node must remain in the graph which was"]
16717 #[doc = " used to instantiate \\p hGraphExec. Changed edges to and from \\p node are ignored."]
16718 #[doc = ""]
16719 #[doc = " The destination memory in \\p pNodeParams must be allocated from the same"]
16720 #[doc = " context as the original destination memory. Both the instantiation-time"]
16721 #[doc = " memory operand and the memory operand in \\p pNodeParams must be 1-dimensional."]
16722 #[doc = " Zero-length operations are not supported."]
16723 #[doc = ""]
16724 #[doc = " The modifications only affect future launches of \\p hGraphExec. Already enqueued"]
16725 #[doc = " or running launches of \\p hGraphExec are not affected by this call. \\p node is also"]
16726 #[doc = " not modified by this call."]
16727 #[doc = ""]
16728 #[doc = " Returns cudaErrorInvalidValue if the memory operand's mappings changed or"]
16729 #[doc = " either the original or new memory operand are multidimensional."]
16730 #[doc = ""]
16731 #[doc = " \\param hGraphExec - The executable graph in which to set the specified node"]
16732 #[doc = " \\param node - Memset node from the graph which was used to instantiate graphExec"]
16733 #[doc = " \\param pNodeParams - Updated Parameters to set"]
16734 #[doc = ""]
16735 #[doc = " \\return"]
16736 #[doc = " ::cudaSuccess,"]
16737 #[doc = " ::cudaErrorInvalidValue,"]
16738 #[doc = " \\note_graph_thread_safety"]
16739 #[doc = " \\notefnerr"]
16740 #[doc = " \\note_init_rt"]
16741 #[doc = " \\note_callback"]
16742 #[doc = ""]
16743 #[doc = " \\sa"]
16744 #[doc = " ::cudaGraphAddMemsetNode,"]
16745 #[doc = " ::cudaGraphMemsetNodeSetParams,"]
16746 #[doc = " ::cudaGraphExecKernelNodeSetParams,"]
16747 #[doc = " ::cudaGraphExecMemcpyNodeSetParams,"]
16748 #[doc = " ::cudaGraphExecHostNodeSetParams,"]
16749 #[doc = " ::cudaGraphExecChildGraphNodeSetParams,"]
16750 #[doc = " ::cudaGraphExecEventRecordNodeSetEvent,"]
16751 #[doc = " ::cudaGraphExecEventWaitNodeSetEvent,"]
16752 #[doc = " ::cudaGraphExecExternalSemaphoresSignalNodeSetParams,"]
16753 #[doc = " ::cudaGraphExecExternalSemaphoresWaitNodeSetParams,"]
16754 #[doc = " ::cudaGraphExecUpdate,"]
16755 #[doc = " ::cudaGraphInstantiate"]
16756 pub fn cudaGraphExecMemsetNodeSetParams(
16757 hGraphExec: cudaGraphExec_t,
16758 node: cudaGraphNode_t,
16759 pNodeParams: *const cudaMemsetParams,
16760 ) -> cudaError_t;
16761}
16762extern "C" {
16763 #[doc = " \\brief Sets the parameters for a host node in the given graphExec."]
16764 #[doc = ""]
16765 #[doc = " Updates the work represented by \\p node in \\p hGraphExec as though \\p node had"]
16766 #[doc = " contained \\p pNodeParams at instantiation. \\p node must remain in the graph which was"]
16767 #[doc = " used to instantiate \\p hGraphExec. Changed edges to and from \\p node are ignored."]
16768 #[doc = ""]
16769 #[doc = " The modifications only affect future launches of \\p hGraphExec. Already enqueued"]
16770 #[doc = " or running launches of \\p hGraphExec are not affected by this call. \\p node is also"]
16771 #[doc = " not modified by this call."]
16772 #[doc = ""]
16773 #[doc = " \\param hGraphExec - The executable graph in which to set the specified node"]
16774 #[doc = " \\param node - Host node from the graph which was used to instantiate graphExec"]
16775 #[doc = " \\param pNodeParams - Updated Parameters to set"]
16776 #[doc = ""]
16777 #[doc = " \\return"]
16778 #[doc = " ::cudaSuccess,"]
16779 #[doc = " ::cudaErrorInvalidValue,"]
16780 #[doc = " \\note_graph_thread_safety"]
16781 #[doc = " \\notefnerr"]
16782 #[doc = " \\note_init_rt"]
16783 #[doc = " \\note_callback"]
16784 #[doc = ""]
16785 #[doc = " \\sa"]
16786 #[doc = " ::cudaGraphAddHostNode,"]
16787 #[doc = " ::cudaGraphHostNodeSetParams,"]
16788 #[doc = " ::cudaGraphExecKernelNodeSetParams,"]
16789 #[doc = " ::cudaGraphExecMemcpyNodeSetParams,"]
16790 #[doc = " ::cudaGraphExecMemsetNodeSetParams,"]
16791 #[doc = " ::cudaGraphExecChildGraphNodeSetParams,"]
16792 #[doc = " ::cudaGraphExecEventRecordNodeSetEvent,"]
16793 #[doc = " ::cudaGraphExecEventWaitNodeSetEvent,"]
16794 #[doc = " ::cudaGraphExecExternalSemaphoresSignalNodeSetParams,"]
16795 #[doc = " ::cudaGraphExecExternalSemaphoresWaitNodeSetParams,"]
16796 #[doc = " ::cudaGraphExecUpdate,"]
16797 #[doc = " ::cudaGraphInstantiate"]
16798 pub fn cudaGraphExecHostNodeSetParams(
16799 hGraphExec: cudaGraphExec_t,
16800 node: cudaGraphNode_t,
16801 pNodeParams: *const cudaHostNodeParams,
16802 ) -> cudaError_t;
16803}
16804extern "C" {
16805 pub fn cudaGraphExecChildGraphNodeSetParams(
16806 hGraphExec: cudaGraphExec_t,
16807 node: cudaGraphNode_t,
16808 childGraph: cudaGraph_t,
16809 ) -> cudaError_t;
16810}
16811extern "C" {
16812 pub fn cudaGraphExecEventRecordNodeSetEvent(
16813 hGraphExec: cudaGraphExec_t,
16814 hNode: cudaGraphNode_t,
16815 event: cudaEvent_t,
16816 ) -> cudaError_t;
16817}
16818extern "C" {
16819 pub fn cudaGraphExecEventWaitNodeSetEvent(
16820 hGraphExec: cudaGraphExec_t,
16821 hNode: cudaGraphNode_t,
16822 event: cudaEvent_t,
16823 ) -> cudaError_t;
16824}
16825extern "C" {
16826 pub fn cudaGraphExecExternalSemaphoresSignalNodeSetParams(
16827 hGraphExec: cudaGraphExec_t,
16828 hNode: cudaGraphNode_t,
16829 nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
16830 ) -> cudaError_t;
16831}
16832extern "C" {
16833 pub fn cudaGraphExecExternalSemaphoresWaitNodeSetParams(
16834 hGraphExec: cudaGraphExec_t,
16835 hNode: cudaGraphNode_t,
16836 nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
16837 ) -> cudaError_t;
16838}
16839extern "C" {
16840 #[doc = " \\brief Check whether an executable graph can be updated with a graph and perform the update if possible"]
16841 #[doc = ""]
16842 #[doc = " Updates the node parameters in the instantiated graph specified by \\p hGraphExec with the"]
16843 #[doc = " node parameters in a topologically identical graph specified by \\p hGraph."]
16844 #[doc = ""]
16845 #[doc = " Limitations:"]
16846 #[doc = ""]
16847 #[doc = " - Kernel nodes:"]
16848 #[doc = " - The owning context of the function cannot change."]
16849 #[doc = " - A node whose function originally did not use CUDA dynamic parallelism cannot be updated"]
16850 #[doc = " to a function which uses CDP"]
16851 #[doc = " - Memset and memcpy nodes:"]
16852 #[doc = " - The CUDA device(s) to which the operand(s) was allocated/mapped cannot change."]
16853 #[doc = " - The source/destination memory must be allocated from the same contexts as the original"]
16854 #[doc = " source/destination memory."]
16855 #[doc = " - Only 1D memsets can be changed."]
16856 #[doc = " - Additional memcpy node restrictions:"]
16857 #[doc = " - Changing either the source or destination memory type(i.e. CU_MEMORYTYPE_DEVICE,"]
16858 #[doc = " CU_MEMORYTYPE_ARRAY, etc.) is not supported."]
16859 #[doc = ""]
16860 #[doc = " Note: The API may add further restrictions in future releases. The return code should always be checked."]
16861 #[doc = ""]
16862 #[doc = " cudaGraphExecUpdate sets \\p updateResult_out to cudaGraphExecUpdateErrorTopologyChanged under"]
16863 #[doc = " the following conditions:"]
16864 #[doc = ""]
16865 #[doc = " - The count of nodes directly in \\p hGraphExec and \\p hGraph differ, in which case \\p hErrorNode_out"]
16866 #[doc = " is NULL."]
16867 #[doc = " - A node is deleted in \\p hGraph but not not its pair from \\p hGraphExec, in which case \\p hErrorNode_out"]
16868 #[doc = " is NULL."]
16869 #[doc = " - A node is deleted in \\p hGraphExec but not its pair from \\p hGraph, in which case \\p hErrorNode_out is"]
16870 #[doc = " the pairless node from \\p hGraph."]
16871 #[doc = " - The dependent nodes of a pair differ, in which case \\p hErrorNode_out is the node from \\p hGraph."]
16872 #[doc = ""]
16873 #[doc = " cudaGraphExecUpdate sets \\p updateResult_out to:"]
16874 #[doc = " - cudaGraphExecUpdateError if passed an invalid value."]
16875 #[doc = " - cudaGraphExecUpdateErrorTopologyChanged if the graph topology changed"]
16876 #[doc = " - cudaGraphExecUpdateErrorNodeTypeChanged if the type of a node changed, in which case"]
16877 #[doc = " \\p hErrorNode_out is set to the node from \\p hGraph."]
16878 #[doc = " - cudaGraphExecUpdateErrorFunctionChanged if the function of a kernel node changed (CUDA driver < 11.2)"]
16879 #[doc = " - cudaGraphExecUpdateErrorUnsupportedFunctionChange if the func field of a kernel changed in an"]
16880 #[doc = " unsupported way(see note above), in which case \\p hErrorNode_out is set to the node from \\p hGraph"]
16881 #[doc = " - cudaGraphExecUpdateErrorParametersChanged if any parameters to a node changed in a way"]
16882 #[doc = " that is not supported, in which case \\p hErrorNode_out is set to the node from \\p hGraph"]
16883 #[doc = " - cudaGraphExecUpdateErrorNotSupported if something about a node is unsupported, like"]
16884 #[doc = " the node's type or configuration, in which case \\p hErrorNode_out is set to the node from \\p hGraph"]
16885 #[doc = ""]
16886 #[doc = " If \\p updateResult_out isn't set in one of the situations described above, the update check passes"]
16887 #[doc = " and cudaGraphExecUpdate updates \\p hGraphExec to match the contents of \\p hGraph. If an error happens"]
16888 #[doc = " during the update, \\p updateResult_out will be set to cudaGraphExecUpdateError; otherwise,"]
16889 #[doc = " \\p updateResult_out is set to cudaGraphExecUpdateSuccess."]
16890 #[doc = ""]
16891 #[doc = " cudaGraphExecUpdate returns cudaSuccess when the updated was performed successfully. It returns"]
16892 #[doc = " cudaErrorGraphExecUpdateFailure if the graph update was not performed because it included"]
16893 #[doc = " changes which violated constraints specific to instantiated graph update."]
16894 #[doc = ""]
16895 #[doc = " \\param hGraphExec The instantiated graph to be updated"]
16896 #[doc = " \\param hGraph The graph containing the updated parameters"]
16897 #[doc = " \\param hErrorNode_out The node which caused the permissibility check to forbid the update, if any"]
16898 #[doc = " \\param updateResult_out Whether the graph update was permitted. If was forbidden, the reason why"]
16899 #[doc = ""]
16900 #[doc = " \\return"]
16901 #[doc = " ::cudaSuccess,"]
16902 #[doc = " ::cudaErrorGraphExecUpdateFailure,"]
16903 #[doc = " \\note_graph_thread_safety"]
16904 #[doc = " \\notefnerr"]
16905 #[doc = " \\note_init_rt"]
16906 #[doc = " \\note_callback"]
16907 #[doc = ""]
16908 #[doc = " \\sa"]
16909 #[doc = " ::cudaGraphInstantiate,"]
16910 pub fn cudaGraphExecUpdate(
16911 hGraphExec: cudaGraphExec_t,
16912 hGraph: cudaGraph_t,
16913 hErrorNode_out: *mut cudaGraphNode_t,
16914 updateResult_out: *mut cudaGraphExecUpdateResult,
16915 ) -> cudaError_t;
16916}
16917extern "C" {
16918 pub fn cudaGraphUpload(graphExec: cudaGraphExec_t, stream: cudaStream_t) -> cudaError_t;
16919}
16920extern "C" {
16921 #[doc = " \\brief Launches an executable graph in a stream"]
16922 #[doc = ""]
16923 #[doc = " Executes \\p graphExec in \\p stream. Only one instance of \\p graphExec may be executing"]
16924 #[doc = " at a time. Each launch is ordered behind both any previous work in \\p stream"]
16925 #[doc = " and any previous launches of \\p graphExec. To execute a graph concurrently, it must be"]
16926 #[doc = " instantiated multiple times into multiple executable graphs."]
16927 #[doc = ""]
16928 #[doc = " If any allocations created by \\p graphExec remain unfreed (from a previous launch) and"]
16929 #[doc = " \\p graphExec was not instantiated with ::cudaGraphInstantiateFlagAutoFreeOnLaunch,"]
16930 #[doc = " the launch will fail with ::cudaErrorInvalidValue."]
16931 #[doc = ""]
16932 #[doc = " \\param graphExec - Executable graph to launch"]
16933 #[doc = " \\param stream - Stream in which to launch the graph"]
16934 #[doc = ""]
16935 #[doc = " \\return"]
16936 #[doc = " ::cudaSuccess,"]
16937 #[doc = " ::cudaErrorInvalidValue"]
16938 #[doc = " \\note_graph_thread_safety"]
16939 #[doc = " \\notefnerr"]
16940 #[doc = " \\note_init_rt"]
16941 #[doc = " \\note_callback"]
16942 #[doc = ""]
16943 #[doc = " \\sa"]
16944 #[doc = " ::cudaGraphInstantiate,"]
16945 #[doc = " ::cudaGraphUpload,"]
16946 #[doc = " ::cudaGraphExecDestroy"]
16947 pub fn cudaGraphLaunch(graphExec: cudaGraphExec_t, stream: cudaStream_t) -> cudaError_t;
16948}
16949extern "C" {
16950 #[doc = " \\brief Destroys an executable graph"]
16951 #[doc = ""]
16952 #[doc = " Destroys the executable graph specified by \\p graphExec."]
16953 #[doc = ""]
16954 #[doc = " \\param graphExec - Executable graph to destroy"]
16955 #[doc = ""]
16956 #[doc = " \\return"]
16957 #[doc = " ::cudaSuccess,"]
16958 #[doc = " ::cudaErrorInvalidValue"]
16959 #[doc = " \\note_graph_thread_safety"]
16960 #[doc = " \\notefnerr"]
16961 #[doc = " \\note_init_rt"]
16962 #[doc = " \\note_callback"]
16963 #[doc = " \\note_destroy_ub"]
16964 #[doc = ""]
16965 #[doc = " \\sa"]
16966 #[doc = " ::cudaGraphInstantiate,"]
16967 #[doc = " ::cudaGraphUpload,"]
16968 #[doc = " ::cudaGraphLaunch"]
16969 pub fn cudaGraphExecDestroy(graphExec: cudaGraphExec_t) -> cudaError_t;
16970}
16971extern "C" {
16972 #[doc = " \\brief Destroys a graph"]
16973 #[doc = ""]
16974 #[doc = " Destroys the graph specified by \\p graph, as well as all of its nodes."]
16975 #[doc = ""]
16976 #[doc = " \\param graph - Graph to destroy"]
16977 #[doc = ""]
16978 #[doc = " \\return"]
16979 #[doc = " ::cudaSuccess,"]
16980 #[doc = " ::cudaErrorInvalidValue"]
16981 #[doc = " \\note_graph_thread_safety"]
16982 #[doc = " \\notefnerr"]
16983 #[doc = " \\note_init_rt"]
16984 #[doc = " \\note_callback"]
16985 #[doc = " \\note_destroy_ub"]
16986 #[doc = ""]
16987 #[doc = " \\sa"]
16988 #[doc = " ::cudaGraphCreate"]
16989 pub fn cudaGraphDestroy(graph: cudaGraph_t) -> cudaError_t;
16990}
16991extern "C" {
16992 #[doc = " \\brief Write a DOT file describing graph structure"]
16993 #[doc = ""]
16994 #[doc = " Using the provided \\p graph, write to \\p path a DOT formatted description of the graph."]
16995 #[doc = " By default this includes the graph topology, node types, node id, kernel names and memcpy direction."]
16996 #[doc = " \\p flags can be specified to write more detailed information about each node type such as"]
16997 #[doc = " parameter values, kernel attributes, node and function handles."]
16998 #[doc = ""]
16999 #[doc = " \\param graph - The graph to create a DOT file from"]
17000 #[doc = " \\param path - The path to write the DOT file to"]
17001 #[doc = " \\param flags - Flags from cudaGraphDebugDotFlags for specifying which additional node information to write"]
17002 #[doc = ""]
17003 #[doc = " \\return"]
17004 #[doc = " ::cudaSuccess,"]
17005 #[doc = " ::cudaErrorInvalidValue,"]
17006 #[doc = " ::cudaErrorOperatingSystem"]
17007 pub fn cudaGraphDebugDotPrint(
17008 graph: cudaGraph_t,
17009 path: *const ::libc::c_char,
17010 flags: ::libc::c_uint,
17011 ) -> cudaError_t;
17012}
17013extern "C" {
17014 #[doc = " \\brief Create a user object"]
17015 #[doc = ""]
17016 #[doc = " Create a user object with the specified destructor callback and initial reference count. The"]
17017 #[doc = " initial references are owned by the caller."]
17018 #[doc = ""]
17019 #[doc = " Destructor callbacks cannot make CUDA API calls and should avoid blocking behavior, as they"]
17020 #[doc = " are executed by a shared internal thread. Another thread may be signaled to perform such"]
17021 #[doc = " actions, if it does not block forward progress of tasks scheduled through CUDA."]
17022 #[doc = ""]
17023 #[doc = " See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects."]
17024 #[doc = ""]
17025 #[doc = " \\param object_out - Location to return the user object handle"]
17026 #[doc = " \\param ptr - The pointer to pass to the destroy function"]
17027 #[doc = " \\param destroy - Callback to free the user object when it is no longer in use"]
17028 #[doc = " \\param initialRefcount - The initial refcount to create the object with, typically 1. The"]
17029 #[doc = " initial references are owned by the calling thread."]
17030 #[doc = " \\param flags - Currently it is required to pass ::cudaUserObjectNoDestructorSync,"]
17031 #[doc = " which is the only defined flag. This indicates that the destroy"]
17032 #[doc = " callback cannot be waited on by any CUDA API. Users requiring"]
17033 #[doc = " synchronization of the callback should signal its completion"]
17034 #[doc = " manually."]
17035 #[doc = ""]
17036 #[doc = " \\return"]
17037 #[doc = " ::cudaSuccess,"]
17038 #[doc = " ::cudaErrorInvalidValue"]
17039 #[doc = ""]
17040 #[doc = " \\sa"]
17041 #[doc = " ::cudaUserObjectRetain,"]
17042 #[doc = " ::cudaUserObjectRelease,"]
17043 #[doc = " ::cudaGraphRetainUserObject,"]
17044 #[doc = " ::cudaGraphReleaseUserObject,"]
17045 #[doc = " ::cudaGraphCreate"]
17046 pub fn cudaUserObjectCreate(
17047 object_out: *mut cudaUserObject_t,
17048 ptr: *mut ::libc::c_void,
17049 destroy: cudaHostFn_t,
17050 initialRefcount: ::libc::c_uint,
17051 flags: ::libc::c_uint,
17052 ) -> cudaError_t;
17053}
17054extern "C" {
17055 #[doc = " \\brief Retain a reference to a user object"]
17056 #[doc = ""]
17057 #[doc = " Retains new references to a user object. The new references are owned by the caller."]
17058 #[doc = ""]
17059 #[doc = " See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects."]
17060 #[doc = ""]
17061 #[doc = " \\param object - The object to retain"]
17062 #[doc = " \\param count - The number of references to retain, typically 1. Must be nonzero"]
17063 #[doc = " and not larger than INT_MAX."]
17064 #[doc = ""]
17065 #[doc = " \\return"]
17066 #[doc = " ::cudaSuccess,"]
17067 #[doc = " ::cudaErrorInvalidValue"]
17068 #[doc = ""]
17069 #[doc = " \\sa"]
17070 #[doc = " ::cudaUserObjectCreate,"]
17071 #[doc = " ::cudaUserObjectRelease,"]
17072 #[doc = " ::cudaGraphRetainUserObject,"]
17073 #[doc = " ::cudaGraphReleaseUserObject,"]
17074 #[doc = " ::cudaGraphCreate"]
17075 pub fn cudaUserObjectRetain(object: cudaUserObject_t, count: ::libc::c_uint) -> cudaError_t;
17076}
17077extern "C" {
17078 #[doc = " \\brief Release a reference to a user object"]
17079 #[doc = ""]
17080 #[doc = " Releases user object references owned by the caller. The object's destructor is invoked if"]
17081 #[doc = " the reference count reaches zero."]
17082 #[doc = ""]
17083 #[doc = " It is undefined behavior to release references not owned by the caller, or to use a user"]
17084 #[doc = " object handle after all references are released."]
17085 #[doc = ""]
17086 #[doc = " See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects."]
17087 #[doc = ""]
17088 #[doc = " \\param object - The object to release"]
17089 #[doc = " \\param count - The number of references to release, typically 1. Must be nonzero"]
17090 #[doc = " and not larger than INT_MAX."]
17091 #[doc = ""]
17092 #[doc = " \\return"]
17093 #[doc = " ::cudaSuccess,"]
17094 #[doc = " ::cudaErrorInvalidValue"]
17095 #[doc = ""]
17096 #[doc = " \\sa"]
17097 #[doc = " ::cudaUserObjectCreate,"]
17098 #[doc = " ::cudaUserObjectRetain,"]
17099 #[doc = " ::cudaGraphRetainUserObject,"]
17100 #[doc = " ::cudaGraphReleaseUserObject,"]
17101 #[doc = " ::cudaGraphCreate"]
17102 pub fn cudaUserObjectRelease(object: cudaUserObject_t, count: ::libc::c_uint) -> cudaError_t;
17103}
17104extern "C" {
17105 #[doc = " \\brief Retain a reference to a user object from a graph"]
17106 #[doc = ""]
17107 #[doc = " Creates or moves user object references that will be owned by a CUDA graph."]
17108 #[doc = ""]
17109 #[doc = " See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects."]
17110 #[doc = ""]
17111 #[doc = " \\param graph - The graph to associate the reference with"]
17112 #[doc = " \\param object - The user object to retain a reference for"]
17113 #[doc = " \\param count - The number of references to add to the graph, typically 1. Must be"]
17114 #[doc = " nonzero and not larger than INT_MAX."]
17115 #[doc = " \\param flags - The optional flag ::cudaGraphUserObjectMove transfers references"]
17116 #[doc = " from the calling thread, rather than create new references. Pass 0"]
17117 #[doc = " to create new references."]
17118 #[doc = ""]
17119 #[doc = " \\return"]
17120 #[doc = " ::cudaSuccess,"]
17121 #[doc = " ::cudaErrorInvalidValue"]
17122 #[doc = ""]
17123 #[doc = " \\sa"]
17124 #[doc = " ::cudaUserObjectCreate"]
17125 #[doc = " ::cudaUserObjectRetain,"]
17126 #[doc = " ::cudaUserObjectRelease,"]
17127 #[doc = " ::cudaGraphReleaseUserObject,"]
17128 #[doc = " ::cudaGraphCreate"]
17129 pub fn cudaGraphRetainUserObject(
17130 graph: cudaGraph_t,
17131 object: cudaUserObject_t,
17132 count: ::libc::c_uint,
17133 flags: ::libc::c_uint,
17134 ) -> cudaError_t;
17135}
17136extern "C" {
17137 #[doc = " \\brief Release a user object reference from a graph"]
17138 #[doc = ""]
17139 #[doc = " Releases user object references owned by a graph."]
17140 #[doc = ""]
17141 #[doc = " See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects."]
17142 #[doc = ""]
17143 #[doc = " \\param graph - The graph that will release the reference"]
17144 #[doc = " \\param object - The user object to release a reference for"]
17145 #[doc = " \\param count - The number of references to release, typically 1. Must be nonzero"]
17146 #[doc = " and not larger than INT_MAX."]
17147 #[doc = ""]
17148 #[doc = " \\return"]
17149 #[doc = " ::cudaSuccess,"]
17150 #[doc = " ::cudaErrorInvalidValue"]
17151 #[doc = ""]
17152 #[doc = " \\sa"]
17153 #[doc = " ::cudaUserObjectCreate"]
17154 #[doc = " ::cudaUserObjectRetain,"]
17155 #[doc = " ::cudaUserObjectRelease,"]
17156 #[doc = " ::cudaGraphRetainUserObject,"]
17157 #[doc = " ::cudaGraphCreate"]
17158 pub fn cudaGraphReleaseUserObject(
17159 graph: cudaGraph_t,
17160 object: cudaUserObject_t,
17161 count: ::libc::c_uint,
17162 ) -> cudaError_t;
17163}
17164extern "C" {
17165 #[doc = " \\brief Returns the requested driver API function pointer"]
17166 #[doc = ""]
17167 #[doc = " Returns in \\p **funcPtr the address of the CUDA driver function for the requested flags."]
17168 #[doc = ""]
17169 #[doc = " For a requested driver symbol, if the CUDA version in which the driver symbol was"]
17170 #[doc = " introduced is less than or equal to the CUDA runtime version, the API will return"]
17171 #[doc = " the function pointer to the corresponding versioned driver function."]
17172 #[doc = ""]
17173 #[doc = " The pointer returned by the API should be cast to a function pointer matching the"]
17174 #[doc = " requested driver function's definition in the API header file. The function pointer"]
17175 #[doc = " typedef can be picked up from the corresponding typedefs header file. For example,"]
17176 #[doc = " cudaTypedefs.h consists of function pointer typedefs for driver APIs defined in cuda.h."]
17177 #[doc = ""]
17178 #[doc = " The API will return ::cudaErrorSymbolNotFound if the requested driver function is not"]
17179 #[doc = " supported on the platform, no ABI compatible driver function exists for the CUDA runtime"]
17180 #[doc = " version or if the driver symbol is invalid."]
17181 #[doc = ""]
17182 #[doc = " The requested flags can be:"]
17183 #[doc = " - ::cudaEnableDefault: This is the default mode. This is equivalent to"]
17184 #[doc = " ::cudaEnablePerThreadDefaultStream if the code is compiled with"]
17185 #[doc = " --default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM"]
17186 #[doc = " is defined; ::cudaEnableLegacyStream otherwise."]
17187 #[doc = " - ::cudaEnableLegacyStream: This will enable the search for all driver symbols"]
17188 #[doc = " that match the requested driver symbol name except the corresponding per-thread versions."]
17189 #[doc = " - ::cudaEnablePerThreadDefaultStream: This will enable the search for all"]
17190 #[doc = " driver symbols that match the requested driver symbol name including the per-thread"]
17191 #[doc = " versions. If a per-thread version is not found, the API will return the legacy version"]
17192 #[doc = " of the driver function."]
17193 #[doc = ""]
17194 #[doc = " \\param symbol - The base name of the driver API function to look for. As an example,"]
17195 #[doc = " for the driver API ::cuMemAlloc_v2, \\p symbol would be cuMemAlloc."]
17196 #[doc = " Note that the API will use the CUDA runtime version to return the"]
17197 #[doc = " address to the most recent ABI compatible driver symbol, ::cuMemAlloc"]
17198 #[doc = " or ::cuMemAlloc_v2."]
17199 #[doc = " \\param funcPtr - Location to return the function pointer to the requested driver function"]
17200 #[doc = " \\param flags - Flags to specify search options."]
17201 #[doc = ""]
17202 #[doc = " \\return"]
17203 #[doc = " ::cudaSuccess,"]
17204 #[doc = " ::cudaErrorInvalidValue,"]
17205 #[doc = " ::cudaErrorNotSupported,"]
17206 #[doc = " ::cudaErrorSymbolNotFound"]
17207 #[doc = " \\note_version_mixing"]
17208 #[doc = " \\note_init_rt"]
17209 #[doc = " \\note_callback"]
17210 #[doc = ""]
17211 #[doc = " \\sa"]
17212 #[doc = " ::cuGetProcAddress"]
17213 pub fn cudaGetDriverEntryPoint(
17214 symbol: *const ::libc::c_char,
17215 funcPtr: *mut *mut ::libc::c_void,
17216 flags: ::libc::c_ulonglong,
17217 ) -> cudaError_t;
17218}
17219extern "C" {
17220 #[doc = " \\cond impl_private"]
17221 pub fn cudaGetExportTable(
17222 ppExportTable: *mut *const ::libc::c_void,
17223 pExportTableId: *const cudaUUID_t,
17224 ) -> cudaError_t;
17225}
17226extern "C" {
17227 #[doc = " \\brief Get pointer to device entry function that matches entry function \\p symbolPtr"]
17228 #[doc = ""]
17229 #[doc = " Returns in \\p functionPtr the device entry function corresponding to the symbol \\p symbolPtr."]
17230 #[doc = ""]
17231 #[doc = " \\param functionPtr - Returns the device entry function"]
17232 #[doc = " \\param symbolPtr - Pointer to device entry function to search for"]
17233 #[doc = ""]
17234 #[doc = " \\return"]
17235 #[doc = " ::cudaSuccess"]
17236 #[doc = ""]
17237 pub fn cudaGetFuncBySymbol(
17238 functionPtr: *mut cudaFunction_t,
17239 symbolPtr: *const ::libc::c_void,
17240 ) -> cudaError_t;
17241}
17242pub type __int32_t = ::libc::c_int;
17243pub type __uint32_t = ::libc::c_uint;
17244pub type __int64_t = ::libc::c_long;
17245#[repr(C)]
17246#[derive(Debug, Copy, Clone)]
17247pub struct cudnnContext {
17248 _unused: [u8; 0],
17249}
17250pub type cudnnHandle_t = *mut cudnnContext;
17251extern "C" {
17252 pub fn cudnnGetVersion() -> usize;
17253}
17254extern "C" {
17255 pub fn cudnnGetCudartVersion() -> usize;
17256}
17257#[repr(u32)]
17258#[non_exhaustive]
17259#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17260pub enum cudnnStatus_t {
17261 CUDNN_STATUS_SUCCESS = 0,
17262 CUDNN_STATUS_NOT_INITIALIZED = 1,
17263 CUDNN_STATUS_ALLOC_FAILED = 2,
17264 CUDNN_STATUS_BAD_PARAM = 3,
17265 CUDNN_STATUS_INTERNAL_ERROR = 4,
17266 CUDNN_STATUS_INVALID_VALUE = 5,
17267 CUDNN_STATUS_ARCH_MISMATCH = 6,
17268 CUDNN_STATUS_MAPPING_ERROR = 7,
17269 CUDNN_STATUS_EXECUTION_FAILED = 8,
17270 CUDNN_STATUS_NOT_SUPPORTED = 9,
17271 CUDNN_STATUS_LICENSE_ERROR = 10,
17272 CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING = 11,
17273 CUDNN_STATUS_RUNTIME_IN_PROGRESS = 12,
17274 CUDNN_STATUS_RUNTIME_FP_OVERFLOW = 13,
17275 CUDNN_STATUS_VERSION_MISMATCH = 14,
17276}
17277extern "C" {
17278 pub fn cudnnGetErrorString(status: cudnnStatus_t) -> *const ::libc::c_char;
17279}
17280#[repr(C)]
17281#[derive(Debug, Copy, Clone)]
17282pub struct cudnnRuntimeTag_t {
17283 _unused: [u8; 0],
17284}
17285#[repr(u32)]
17286#[non_exhaustive]
17287#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17288pub enum cudnnErrQueryMode_t {
17289 CUDNN_ERRQUERY_RAWCODE = 0,
17290 CUDNN_ERRQUERY_NONBLOCKING = 1,
17291 CUDNN_ERRQUERY_BLOCKING = 2,
17292}
17293extern "C" {
17294 pub fn cudnnQueryRuntimeError(
17295 handle: cudnnHandle_t,
17296 rstatus: *mut cudnnStatus_t,
17297 mode: cudnnErrQueryMode_t,
17298 tag: *mut cudnnRuntimeTag_t,
17299 ) -> cudnnStatus_t;
17300}
17301extern "C" {
17302 pub fn cudnnGetProperty(type_: libraryPropertyType, value: *mut ::libc::c_int)
17303 -> cudnnStatus_t;
17304}
17305extern "C" {
17306 pub fn cudnnCreate(handle: *mut cudnnHandle_t) -> cudnnStatus_t;
17307}
17308extern "C" {
17309 pub fn cudnnDestroy(handle: cudnnHandle_t) -> cudnnStatus_t;
17310}
17311extern "C" {
17312 pub fn cudnnSetStream(handle: cudnnHandle_t, streamId: cudaStream_t) -> cudnnStatus_t;
17313}
17314extern "C" {
17315 pub fn cudnnGetStream(handle: cudnnHandle_t, streamId: *mut cudaStream_t) -> cudnnStatus_t;
17316}
17317#[repr(C)]
17318#[derive(Debug, Copy, Clone)]
17319pub struct cudnnTensorStruct {
17320 _unused: [u8; 0],
17321}
17322pub type cudnnTensorDescriptor_t = *mut cudnnTensorStruct;
17323#[repr(C)]
17324#[derive(Debug, Copy, Clone)]
17325pub struct cudnnPoolingStruct {
17326 _unused: [u8; 0],
17327}
17328pub type cudnnPoolingDescriptor_t = *mut cudnnPoolingStruct;
17329#[repr(C)]
17330#[derive(Debug, Copy, Clone)]
17331pub struct cudnnFilterStruct {
17332 _unused: [u8; 0],
17333}
17334pub type cudnnFilterDescriptor_t = *mut cudnnFilterStruct;
17335#[repr(C)]
17336#[derive(Debug, Copy, Clone)]
17337pub struct cudnnLRNStruct {
17338 _unused: [u8; 0],
17339}
17340pub type cudnnLRNDescriptor_t = *mut cudnnLRNStruct;
17341#[repr(C)]
17342#[derive(Debug, Copy, Clone)]
17343pub struct cudnnActivationStruct {
17344 _unused: [u8; 0],
17345}
17346pub type cudnnActivationDescriptor_t = *mut cudnnActivationStruct;
17347#[repr(C)]
17348#[derive(Debug, Copy, Clone)]
17349pub struct cudnnSpatialTransformerStruct {
17350 _unused: [u8; 0],
17351}
17352pub type cudnnSpatialTransformerDescriptor_t = *mut cudnnSpatialTransformerStruct;
17353#[repr(C)]
17354#[derive(Debug, Copy, Clone)]
17355pub struct cudnnOpTensorStruct {
17356 _unused: [u8; 0],
17357}
17358pub type cudnnOpTensorDescriptor_t = *mut cudnnOpTensorStruct;
17359#[repr(C)]
17360#[derive(Debug, Copy, Clone)]
17361pub struct cudnnReduceTensorStruct {
17362 _unused: [u8; 0],
17363}
17364pub type cudnnReduceTensorDescriptor_t = *mut cudnnReduceTensorStruct;
17365#[repr(C)]
17366#[derive(Debug, Copy, Clone)]
17367pub struct cudnnCTCLossStruct {
17368 _unused: [u8; 0],
17369}
17370pub type cudnnCTCLossDescriptor_t = *mut cudnnCTCLossStruct;
17371#[repr(C)]
17372#[derive(Debug, Copy, Clone)]
17373pub struct cudnnTensorTransformStruct {
17374 _unused: [u8; 0],
17375}
17376pub type cudnnTensorTransformDescriptor_t = *mut cudnnTensorTransformStruct;
17377#[repr(u32)]
17378#[non_exhaustive]
17379#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17380pub enum cudnnDataType_t {
17381 CUDNN_DATA_FLOAT = 0,
17382 CUDNN_DATA_DOUBLE = 1,
17383 CUDNN_DATA_HALF = 2,
17384 CUDNN_DATA_INT8 = 3,
17385 CUDNN_DATA_INT32 = 4,
17386 CUDNN_DATA_INT8x4 = 5,
17387 CUDNN_DATA_UINT8 = 6,
17388 CUDNN_DATA_UINT8x4 = 7,
17389 CUDNN_DATA_INT8x32 = 8,
17390 CUDNN_DATA_BFLOAT16 = 9,
17391 CUDNN_DATA_INT64 = 10,
17392}
17393#[repr(u32)]
17394#[non_exhaustive]
17395#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17396pub enum cudnnMathType_t {
17397 CUDNN_DEFAULT_MATH = 0,
17398 CUDNN_TENSOR_OP_MATH = 1,
17399 CUDNN_TENSOR_OP_MATH_ALLOW_CONVERSION = 2,
17400 CUDNN_FMA_MATH = 3,
17401}
17402#[repr(u32)]
17403#[non_exhaustive]
17404#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17405pub enum cudnnNanPropagation_t {
17406 CUDNN_NOT_PROPAGATE_NAN = 0,
17407 CUDNN_PROPAGATE_NAN = 1,
17408}
17409#[repr(u32)]
17410#[non_exhaustive]
17411#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17412pub enum cudnnDeterminism_t {
17413 CUDNN_NON_DETERMINISTIC = 0,
17414 CUDNN_DETERMINISTIC = 1,
17415}
17416extern "C" {
17417 pub fn cudnnCreateTensorDescriptor(tensorDesc: *mut cudnnTensorDescriptor_t) -> cudnnStatus_t;
17418}
17419#[repr(u32)]
17420#[non_exhaustive]
17421#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17422pub enum cudnnTensorFormat_t {
17423 CUDNN_TENSOR_NCHW = 0,
17424 CUDNN_TENSOR_NHWC = 1,
17425 CUDNN_TENSOR_NCHW_VECT_C = 2,
17426}
17427extern "C" {
17428 pub fn cudnnSetTensor4dDescriptor(
17429 tensorDesc: cudnnTensorDescriptor_t,
17430 format: cudnnTensorFormat_t,
17431 dataType: cudnnDataType_t,
17432 n: ::libc::c_int,
17433 c: ::libc::c_int,
17434 h: ::libc::c_int,
17435 w: ::libc::c_int,
17436 ) -> cudnnStatus_t;
17437}
17438extern "C" {
17439 pub fn cudnnSetTensor4dDescriptorEx(
17440 tensorDesc: cudnnTensorDescriptor_t,
17441 dataType: cudnnDataType_t,
17442 n: ::libc::c_int,
17443 c: ::libc::c_int,
17444 h: ::libc::c_int,
17445 w: ::libc::c_int,
17446 nStride: ::libc::c_int,
17447 cStride: ::libc::c_int,
17448 hStride: ::libc::c_int,
17449 wStride: ::libc::c_int,
17450 ) -> cudnnStatus_t;
17451}
17452extern "C" {
17453 pub fn cudnnGetTensor4dDescriptor(
17454 tensorDesc: cudnnTensorDescriptor_t,
17455 dataType: *mut cudnnDataType_t,
17456 n: *mut ::libc::c_int,
17457 c: *mut ::libc::c_int,
17458 h: *mut ::libc::c_int,
17459 w: *mut ::libc::c_int,
17460 nStride: *mut ::libc::c_int,
17461 cStride: *mut ::libc::c_int,
17462 hStride: *mut ::libc::c_int,
17463 wStride: *mut ::libc::c_int,
17464 ) -> cudnnStatus_t;
17465}
17466extern "C" {
17467 pub fn cudnnSetTensorNdDescriptor(
17468 tensorDesc: cudnnTensorDescriptor_t,
17469 dataType: cudnnDataType_t,
17470 nbDims: ::libc::c_int,
17471 dimA: *const ::libc::c_int,
17472 strideA: *const ::libc::c_int,
17473 ) -> cudnnStatus_t;
17474}
17475extern "C" {
17476 pub fn cudnnSetTensorNdDescriptorEx(
17477 tensorDesc: cudnnTensorDescriptor_t,
17478 format: cudnnTensorFormat_t,
17479 dataType: cudnnDataType_t,
17480 nbDims: ::libc::c_int,
17481 dimA: *const ::libc::c_int,
17482 ) -> cudnnStatus_t;
17483}
17484extern "C" {
17485 pub fn cudnnGetTensorNdDescriptor(
17486 tensorDesc: cudnnTensorDescriptor_t,
17487 nbDimsRequested: ::libc::c_int,
17488 dataType: *mut cudnnDataType_t,
17489 nbDims: *mut ::libc::c_int,
17490 dimA: *mut ::libc::c_int,
17491 strideA: *mut ::libc::c_int,
17492 ) -> cudnnStatus_t;
17493}
17494extern "C" {
17495 pub fn cudnnGetTensorSizeInBytes(
17496 tensorDesc: cudnnTensorDescriptor_t,
17497 size: *mut usize,
17498 ) -> cudnnStatus_t;
17499}
17500extern "C" {
17501 pub fn cudnnDestroyTensorDescriptor(tensorDesc: cudnnTensorDescriptor_t) -> cudnnStatus_t;
17502}
17503#[repr(u32)]
17504#[non_exhaustive]
17505#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17506pub enum cudnnFoldingDirection_t {
17507 CUDNN_TRANSFORM_FOLD = 0,
17508 CUDNN_TRANSFORM_UNFOLD = 1,
17509}
17510extern "C" {
17511 #[doc = " Create a destination descriptor for cudnnTransformTensor"]
17512 pub fn cudnnInitTransformDest(
17513 transformDesc: cudnnTensorTransformDescriptor_t,
17514 srcDesc: cudnnTensorDescriptor_t,
17515 destDesc: cudnnTensorDescriptor_t,
17516 destSizeInBytes: *mut usize,
17517 ) -> cudnnStatus_t;
17518}
17519extern "C" {
17520 #[doc = " Create an empty tensor transform descriptor"]
17521 pub fn cudnnCreateTensorTransformDescriptor(
17522 transformDesc: *mut cudnnTensorTransformDescriptor_t,
17523 ) -> cudnnStatus_t;
17524}
17525extern "C" {
17526 #[doc = " Initialize a previously created tensor transform descriptor."]
17527 pub fn cudnnSetTensorTransformDescriptor(
17528 transformDesc: cudnnTensorTransformDescriptor_t,
17529 nbDims: u32,
17530 destFormat: cudnnTensorFormat_t,
17531 padBeforeA: *const i32,
17532 padAfterA: *const i32,
17533 foldA: *const u32,
17534 direction: cudnnFoldingDirection_t,
17535 ) -> cudnnStatus_t;
17536}
17537extern "C" {
17538 #[doc = " Retrieves the values stored in a previously initialized tensor transform"]
17539 #[doc = " descriptor."]
17540 pub fn cudnnGetTensorTransformDescriptor(
17541 transformDesc: cudnnTensorTransformDescriptor_t,
17542 nbDimsRequested: u32,
17543 destFormat: *mut cudnnTensorFormat_t,
17544 padBeforeA: *mut i32,
17545 padAfterA: *mut i32,
17546 foldA: *mut u32,
17547 direction: *mut cudnnFoldingDirection_t,
17548 ) -> cudnnStatus_t;
17549}
17550extern "C" {
17551 #[doc = " Destroys a previously created tensor transform descriptor."]
17552 pub fn cudnnDestroyTensorTransformDescriptor(
17553 transformDesc: cudnnTensorTransformDescriptor_t,
17554 ) -> cudnnStatus_t;
17555}
17556extern "C" {
17557 pub fn cudnnTransformTensor(
17558 handle: cudnnHandle_t,
17559 alpha: *const ::libc::c_void,
17560 xDesc: cudnnTensorDescriptor_t,
17561 x: *const ::libc::c_void,
17562 beta: *const ::libc::c_void,
17563 yDesc: cudnnTensorDescriptor_t,
17564 y: *mut ::libc::c_void,
17565 ) -> cudnnStatus_t;
17566}
17567extern "C" {
17568 pub fn cudnnTransformTensorEx(
17569 handle: cudnnHandle_t,
17570 transDesc: cudnnTensorTransformDescriptor_t,
17571 alpha: *const ::libc::c_void,
17572 srcDesc: cudnnTensorDescriptor_t,
17573 srcData: *const ::libc::c_void,
17574 beta: *const ::libc::c_void,
17575 destDesc: cudnnTensorDescriptor_t,
17576 destData: *mut ::libc::c_void,
17577 ) -> cudnnStatus_t;
17578}
17579extern "C" {
17580 pub fn cudnnAddTensor(
17581 handle: cudnnHandle_t,
17582 alpha: *const ::libc::c_void,
17583 aDesc: cudnnTensorDescriptor_t,
17584 A: *const ::libc::c_void,
17585 beta: *const ::libc::c_void,
17586 cDesc: cudnnTensorDescriptor_t,
17587 C: *mut ::libc::c_void,
17588 ) -> cudnnStatus_t;
17589}
17590#[repr(u32)]
17591#[non_exhaustive]
17592#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17593pub enum cudnnOpTensorOp_t {
17594 CUDNN_OP_TENSOR_ADD = 0,
17595 CUDNN_OP_TENSOR_MUL = 1,
17596 CUDNN_OP_TENSOR_MIN = 2,
17597 CUDNN_OP_TENSOR_MAX = 3,
17598 CUDNN_OP_TENSOR_SQRT = 4,
17599 CUDNN_OP_TENSOR_NOT = 5,
17600}
17601extern "C" {
17602 pub fn cudnnCreateOpTensorDescriptor(
17603 opTensorDesc: *mut cudnnOpTensorDescriptor_t,
17604 ) -> cudnnStatus_t;
17605}
17606extern "C" {
17607 pub fn cudnnSetOpTensorDescriptor(
17608 opTensorDesc: cudnnOpTensorDescriptor_t,
17609 opTensorOp: cudnnOpTensorOp_t,
17610 opTensorCompType: cudnnDataType_t,
17611 opTensorNanOpt: cudnnNanPropagation_t,
17612 ) -> cudnnStatus_t;
17613}
17614extern "C" {
17615 pub fn cudnnGetOpTensorDescriptor(
17616 opTensorDesc: cudnnOpTensorDescriptor_t,
17617 opTensorOp: *mut cudnnOpTensorOp_t,
17618 opTensorCompType: *mut cudnnDataType_t,
17619 opTensorNanOpt: *mut cudnnNanPropagation_t,
17620 ) -> cudnnStatus_t;
17621}
17622extern "C" {
17623 pub fn cudnnDestroyOpTensorDescriptor(opTensorDesc: cudnnOpTensorDescriptor_t)
17624 -> cudnnStatus_t;
17625}
17626extern "C" {
17627 pub fn cudnnOpTensor(
17628 handle: cudnnHandle_t,
17629 opTensorDesc: cudnnOpTensorDescriptor_t,
17630 alpha1: *const ::libc::c_void,
17631 aDesc: cudnnTensorDescriptor_t,
17632 A: *const ::libc::c_void,
17633 alpha2: *const ::libc::c_void,
17634 bDesc: cudnnTensorDescriptor_t,
17635 B: *const ::libc::c_void,
17636 beta: *const ::libc::c_void,
17637 cDesc: cudnnTensorDescriptor_t,
17638 C: *mut ::libc::c_void,
17639 ) -> cudnnStatus_t;
17640}
17641#[repr(u32)]
17642#[non_exhaustive]
17643#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17644pub enum cudnnReduceTensorOp_t {
17645 CUDNN_REDUCE_TENSOR_ADD = 0,
17646 CUDNN_REDUCE_TENSOR_MUL = 1,
17647 CUDNN_REDUCE_TENSOR_MIN = 2,
17648 CUDNN_REDUCE_TENSOR_MAX = 3,
17649 CUDNN_REDUCE_TENSOR_AMAX = 4,
17650 CUDNN_REDUCE_TENSOR_AVG = 5,
17651 CUDNN_REDUCE_TENSOR_NORM1 = 6,
17652 CUDNN_REDUCE_TENSOR_NORM2 = 7,
17653 CUDNN_REDUCE_TENSOR_MUL_NO_ZEROS = 8,
17654}
17655#[repr(u32)]
17656#[non_exhaustive]
17657#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17658pub enum cudnnReduceTensorIndices_t {
17659 CUDNN_REDUCE_TENSOR_NO_INDICES = 0,
17660 CUDNN_REDUCE_TENSOR_FLATTENED_INDICES = 1,
17661}
17662#[repr(u32)]
17663#[non_exhaustive]
17664#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17665pub enum cudnnIndicesType_t {
17666 CUDNN_32BIT_INDICES = 0,
17667 CUDNN_64BIT_INDICES = 1,
17668 CUDNN_16BIT_INDICES = 2,
17669 CUDNN_8BIT_INDICES = 3,
17670}
17671extern "C" {
17672 pub fn cudnnCreateReduceTensorDescriptor(
17673 reduceTensorDesc: *mut cudnnReduceTensorDescriptor_t,
17674 ) -> cudnnStatus_t;
17675}
17676extern "C" {
17677 pub fn cudnnSetReduceTensorDescriptor(
17678 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17679 reduceTensorOp: cudnnReduceTensorOp_t,
17680 reduceTensorCompType: cudnnDataType_t,
17681 reduceTensorNanOpt: cudnnNanPropagation_t,
17682 reduceTensorIndices: cudnnReduceTensorIndices_t,
17683 reduceTensorIndicesType: cudnnIndicesType_t,
17684 ) -> cudnnStatus_t;
17685}
17686extern "C" {
17687 pub fn cudnnGetReduceTensorDescriptor(
17688 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17689 reduceTensorOp: *mut cudnnReduceTensorOp_t,
17690 reduceTensorCompType: *mut cudnnDataType_t,
17691 reduceTensorNanOpt: *mut cudnnNanPropagation_t,
17692 reduceTensorIndices: *mut cudnnReduceTensorIndices_t,
17693 reduceTensorIndicesType: *mut cudnnIndicesType_t,
17694 ) -> cudnnStatus_t;
17695}
17696extern "C" {
17697 pub fn cudnnDestroyReduceTensorDescriptor(
17698 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17699 ) -> cudnnStatus_t;
17700}
17701extern "C" {
17702 pub fn cudnnGetReductionIndicesSize(
17703 handle: cudnnHandle_t,
17704 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17705 aDesc: cudnnTensorDescriptor_t,
17706 cDesc: cudnnTensorDescriptor_t,
17707 sizeInBytes: *mut usize,
17708 ) -> cudnnStatus_t;
17709}
17710extern "C" {
17711 pub fn cudnnGetReductionWorkspaceSize(
17712 handle: cudnnHandle_t,
17713 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17714 aDesc: cudnnTensorDescriptor_t,
17715 cDesc: cudnnTensorDescriptor_t,
17716 sizeInBytes: *mut usize,
17717 ) -> cudnnStatus_t;
17718}
17719extern "C" {
17720 pub fn cudnnReduceTensor(
17721 handle: cudnnHandle_t,
17722 reduceTensorDesc: cudnnReduceTensorDescriptor_t,
17723 indices: *mut ::libc::c_void,
17724 indicesSizeInBytes: usize,
17725 workspace: *mut ::libc::c_void,
17726 workspaceSizeInBytes: usize,
17727 alpha: *const ::libc::c_void,
17728 aDesc: cudnnTensorDescriptor_t,
17729 A: *const ::libc::c_void,
17730 beta: *const ::libc::c_void,
17731 cDesc: cudnnTensorDescriptor_t,
17732 C: *mut ::libc::c_void,
17733 ) -> cudnnStatus_t;
17734}
17735extern "C" {
17736 pub fn cudnnSetTensor(
17737 handle: cudnnHandle_t,
17738 yDesc: cudnnTensorDescriptor_t,
17739 y: *mut ::libc::c_void,
17740 valuePtr: *const ::libc::c_void,
17741 ) -> cudnnStatus_t;
17742}
17743extern "C" {
17744 pub fn cudnnScaleTensor(
17745 handle: cudnnHandle_t,
17746 yDesc: cudnnTensorDescriptor_t,
17747 y: *mut ::libc::c_void,
17748 alpha: *const ::libc::c_void,
17749 ) -> cudnnStatus_t;
17750}
17751extern "C" {
17752 pub fn cudnnCreateFilterDescriptor(filterDesc: *mut cudnnFilterDescriptor_t) -> cudnnStatus_t;
17753}
17754extern "C" {
17755 pub fn cudnnSetFilter4dDescriptor(
17756 filterDesc: cudnnFilterDescriptor_t,
17757 dataType: cudnnDataType_t,
17758 format: cudnnTensorFormat_t,
17759 k: ::libc::c_int,
17760 c: ::libc::c_int,
17761 h: ::libc::c_int,
17762 w: ::libc::c_int,
17763 ) -> cudnnStatus_t;
17764}
17765extern "C" {
17766 pub fn cudnnGetFilter4dDescriptor(
17767 filterDesc: cudnnFilterDescriptor_t,
17768 dataType: *mut cudnnDataType_t,
17769 format: *mut cudnnTensorFormat_t,
17770 k: *mut ::libc::c_int,
17771 c: *mut ::libc::c_int,
17772 h: *mut ::libc::c_int,
17773 w: *mut ::libc::c_int,
17774 ) -> cudnnStatus_t;
17775}
17776extern "C" {
17777 pub fn cudnnSetFilterNdDescriptor(
17778 filterDesc: cudnnFilterDescriptor_t,
17779 dataType: cudnnDataType_t,
17780 format: cudnnTensorFormat_t,
17781 nbDims: ::libc::c_int,
17782 filterDimA: *const ::libc::c_int,
17783 ) -> cudnnStatus_t;
17784}
17785extern "C" {
17786 pub fn cudnnGetFilterNdDescriptor(
17787 filterDesc: cudnnFilterDescriptor_t,
17788 nbDimsRequested: ::libc::c_int,
17789 dataType: *mut cudnnDataType_t,
17790 format: *mut cudnnTensorFormat_t,
17791 nbDims: *mut ::libc::c_int,
17792 filterDimA: *mut ::libc::c_int,
17793 ) -> cudnnStatus_t;
17794}
17795extern "C" {
17796 pub fn cudnnGetFilterSizeInBytes(
17797 filterDesc: cudnnFilterDescriptor_t,
17798 size: *mut usize,
17799 ) -> cudnnStatus_t;
17800}
17801extern "C" {
17802 pub fn cudnnTransformFilter(
17803 handle: cudnnHandle_t,
17804 transDesc: cudnnTensorTransformDescriptor_t,
17805 alpha: *const ::libc::c_void,
17806 srcDesc: cudnnFilterDescriptor_t,
17807 srcData: *const ::libc::c_void,
17808 beta: *const ::libc::c_void,
17809 destDesc: cudnnFilterDescriptor_t,
17810 destData: *mut ::libc::c_void,
17811 ) -> cudnnStatus_t;
17812}
17813extern "C" {
17814 pub fn cudnnDestroyFilterDescriptor(filterDesc: cudnnFilterDescriptor_t) -> cudnnStatus_t;
17815}
17816#[repr(u32)]
17817#[non_exhaustive]
17818#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17819pub enum cudnnSoftmaxAlgorithm_t {
17820 CUDNN_SOFTMAX_FAST = 0,
17821 CUDNN_SOFTMAX_ACCURATE = 1,
17822 CUDNN_SOFTMAX_LOG = 2,
17823}
17824#[repr(u32)]
17825#[non_exhaustive]
17826#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17827pub enum cudnnSoftmaxMode_t {
17828 CUDNN_SOFTMAX_MODE_INSTANCE = 0,
17829 CUDNN_SOFTMAX_MODE_CHANNEL = 1,
17830}
17831extern "C" {
17832 pub fn cudnnSoftmaxForward(
17833 handle: cudnnHandle_t,
17834 algo: cudnnSoftmaxAlgorithm_t,
17835 mode: cudnnSoftmaxMode_t,
17836 alpha: *const ::libc::c_void,
17837 xDesc: cudnnTensorDescriptor_t,
17838 x: *const ::libc::c_void,
17839 beta: *const ::libc::c_void,
17840 yDesc: cudnnTensorDescriptor_t,
17841 y: *mut ::libc::c_void,
17842 ) -> cudnnStatus_t;
17843}
17844#[repr(u32)]
17845#[non_exhaustive]
17846#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17847pub enum cudnnPoolingMode_t {
17848 CUDNN_POOLING_MAX = 0,
17849 CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING = 1,
17850 CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING = 2,
17851 CUDNN_POOLING_MAX_DETERMINISTIC = 3,
17852}
17853extern "C" {
17854 pub fn cudnnCreatePoolingDescriptor(
17855 poolingDesc: *mut cudnnPoolingDescriptor_t,
17856 ) -> cudnnStatus_t;
17857}
17858extern "C" {
17859 pub fn cudnnSetPooling2dDescriptor(
17860 poolingDesc: cudnnPoolingDescriptor_t,
17861 mode: cudnnPoolingMode_t,
17862 maxpoolingNanOpt: cudnnNanPropagation_t,
17863 windowHeight: ::libc::c_int,
17864 windowWidth: ::libc::c_int,
17865 verticalPadding: ::libc::c_int,
17866 horizontalPadding: ::libc::c_int,
17867 verticalStride: ::libc::c_int,
17868 horizontalStride: ::libc::c_int,
17869 ) -> cudnnStatus_t;
17870}
17871extern "C" {
17872 pub fn cudnnGetPooling2dDescriptor(
17873 poolingDesc: cudnnPoolingDescriptor_t,
17874 mode: *mut cudnnPoolingMode_t,
17875 maxpoolingNanOpt: *mut cudnnNanPropagation_t,
17876 windowHeight: *mut ::libc::c_int,
17877 windowWidth: *mut ::libc::c_int,
17878 verticalPadding: *mut ::libc::c_int,
17879 horizontalPadding: *mut ::libc::c_int,
17880 verticalStride: *mut ::libc::c_int,
17881 horizontalStride: *mut ::libc::c_int,
17882 ) -> cudnnStatus_t;
17883}
17884extern "C" {
17885 pub fn cudnnSetPoolingNdDescriptor(
17886 poolingDesc: cudnnPoolingDescriptor_t,
17887 mode: cudnnPoolingMode_t,
17888 maxpoolingNanOpt: cudnnNanPropagation_t,
17889 nbDims: ::libc::c_int,
17890 windowDimA: *const ::libc::c_int,
17891 paddingA: *const ::libc::c_int,
17892 strideA: *const ::libc::c_int,
17893 ) -> cudnnStatus_t;
17894}
17895extern "C" {
17896 pub fn cudnnGetPoolingNdDescriptor(
17897 poolingDesc: cudnnPoolingDescriptor_t,
17898 nbDimsRequested: ::libc::c_int,
17899 mode: *mut cudnnPoolingMode_t,
17900 maxpoolingNanOpt: *mut cudnnNanPropagation_t,
17901 nbDims: *mut ::libc::c_int,
17902 windowDimA: *mut ::libc::c_int,
17903 paddingA: *mut ::libc::c_int,
17904 strideA: *mut ::libc::c_int,
17905 ) -> cudnnStatus_t;
17906}
17907extern "C" {
17908 pub fn cudnnGetPoolingNdForwardOutputDim(
17909 poolingDesc: cudnnPoolingDescriptor_t,
17910 inputTensorDesc: cudnnTensorDescriptor_t,
17911 nbDims: ::libc::c_int,
17912 outputTensorDimA: *mut ::libc::c_int,
17913 ) -> cudnnStatus_t;
17914}
17915extern "C" {
17916 pub fn cudnnGetPooling2dForwardOutputDim(
17917 poolingDesc: cudnnPoolingDescriptor_t,
17918 inputTensorDesc: cudnnTensorDescriptor_t,
17919 n: *mut ::libc::c_int,
17920 c: *mut ::libc::c_int,
17921 h: *mut ::libc::c_int,
17922 w: *mut ::libc::c_int,
17923 ) -> cudnnStatus_t;
17924}
17925extern "C" {
17926 pub fn cudnnDestroyPoolingDescriptor(poolingDesc: cudnnPoolingDescriptor_t) -> cudnnStatus_t;
17927}
17928extern "C" {
17929 pub fn cudnnPoolingForward(
17930 handle: cudnnHandle_t,
17931 poolingDesc: cudnnPoolingDescriptor_t,
17932 alpha: *const ::libc::c_void,
17933 xDesc: cudnnTensorDescriptor_t,
17934 x: *const ::libc::c_void,
17935 beta: *const ::libc::c_void,
17936 yDesc: cudnnTensorDescriptor_t,
17937 y: *mut ::libc::c_void,
17938 ) -> cudnnStatus_t;
17939}
17940#[repr(u32)]
17941#[non_exhaustive]
17942#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
17943pub enum cudnnActivationMode_t {
17944 CUDNN_ACTIVATION_SIGMOID = 0,
17945 CUDNN_ACTIVATION_RELU = 1,
17946 CUDNN_ACTIVATION_TANH = 2,
17947 CUDNN_ACTIVATION_CLIPPED_RELU = 3,
17948 CUDNN_ACTIVATION_ELU = 4,
17949 CUDNN_ACTIVATION_IDENTITY = 5,
17950 CUDNN_ACTIVATION_SWISH = 6,
17951}
17952extern "C" {
17953 pub fn cudnnCreateActivationDescriptor(
17954 activationDesc: *mut cudnnActivationDescriptor_t,
17955 ) -> cudnnStatus_t;
17956}
17957extern "C" {
17958 pub fn cudnnSetActivationDescriptor(
17959 activationDesc: cudnnActivationDescriptor_t,
17960 mode: cudnnActivationMode_t,
17961 reluNanOpt: cudnnNanPropagation_t,
17962 coef: f64,
17963 ) -> cudnnStatus_t;
17964}
17965extern "C" {
17966 pub fn cudnnGetActivationDescriptor(
17967 activationDesc: cudnnActivationDescriptor_t,
17968 mode: *mut cudnnActivationMode_t,
17969 reluNanOpt: *mut cudnnNanPropagation_t,
17970 coef: *mut f64,
17971 ) -> cudnnStatus_t;
17972}
17973extern "C" {
17974 pub fn cudnnSetActivationDescriptorSwishBeta(
17975 activationDesc: cudnnActivationDescriptor_t,
17976 swish_beta: f64,
17977 ) -> cudnnStatus_t;
17978}
17979extern "C" {
17980 pub fn cudnnGetActivationDescriptorSwishBeta(
17981 activationDesc: cudnnActivationDescriptor_t,
17982 swish_beta: *mut f64,
17983 ) -> cudnnStatus_t;
17984}
17985extern "C" {
17986 pub fn cudnnDestroyActivationDescriptor(
17987 activationDesc: cudnnActivationDescriptor_t,
17988 ) -> cudnnStatus_t;
17989}
17990extern "C" {
17991 pub fn cudnnActivationForward(
17992 handle: cudnnHandle_t,
17993 activationDesc: cudnnActivationDescriptor_t,
17994 alpha: *const ::libc::c_void,
17995 xDesc: cudnnTensorDescriptor_t,
17996 x: *const ::libc::c_void,
17997 beta: *const ::libc::c_void,
17998 yDesc: cudnnTensorDescriptor_t,
17999 y: *mut ::libc::c_void,
18000 ) -> cudnnStatus_t;
18001}
18002extern "C" {
18003 pub fn cudnnCreateLRNDescriptor(normDesc: *mut cudnnLRNDescriptor_t) -> cudnnStatus_t;
18004}
18005#[repr(u32)]
18006#[non_exhaustive]
18007#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18008pub enum cudnnLRNMode_t {
18009 CUDNN_LRN_CROSS_CHANNEL_DIM1 = 0,
18010}
18011extern "C" {
18012 pub fn cudnnSetLRNDescriptor(
18013 normDesc: cudnnLRNDescriptor_t,
18014 lrnN: ::libc::c_uint,
18015 lrnAlpha: f64,
18016 lrnBeta: f64,
18017 lrnK: f64,
18018 ) -> cudnnStatus_t;
18019}
18020extern "C" {
18021 pub fn cudnnGetLRNDescriptor(
18022 normDesc: cudnnLRNDescriptor_t,
18023 lrnN: *mut ::libc::c_uint,
18024 lrnAlpha: *mut f64,
18025 lrnBeta: *mut f64,
18026 lrnK: *mut f64,
18027 ) -> cudnnStatus_t;
18028}
18029extern "C" {
18030 pub fn cudnnDestroyLRNDescriptor(lrnDesc: cudnnLRNDescriptor_t) -> cudnnStatus_t;
18031}
18032extern "C" {
18033 pub fn cudnnLRNCrossChannelForward(
18034 handle: cudnnHandle_t,
18035 normDesc: cudnnLRNDescriptor_t,
18036 lrnMode: cudnnLRNMode_t,
18037 alpha: *const ::libc::c_void,
18038 xDesc: cudnnTensorDescriptor_t,
18039 x: *const ::libc::c_void,
18040 beta: *const ::libc::c_void,
18041 yDesc: cudnnTensorDescriptor_t,
18042 y: *mut ::libc::c_void,
18043 ) -> cudnnStatus_t;
18044}
18045#[repr(u32)]
18046#[non_exhaustive]
18047#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18048pub enum cudnnDivNormMode_t {
18049 CUDNN_DIVNORM_PRECOMPUTED_MEANS = 0,
18050}
18051extern "C" {
18052 pub fn cudnnDivisiveNormalizationForward(
18053 handle: cudnnHandle_t,
18054 normDesc: cudnnLRNDescriptor_t,
18055 mode: cudnnDivNormMode_t,
18056 alpha: *const ::libc::c_void,
18057 xDesc: cudnnTensorDescriptor_t,
18058 x: *const ::libc::c_void,
18059 means: *const ::libc::c_void,
18060 temp: *mut ::libc::c_void,
18061 temp2: *mut ::libc::c_void,
18062 beta: *const ::libc::c_void,
18063 yDesc: cudnnTensorDescriptor_t,
18064 y: *mut ::libc::c_void,
18065 ) -> cudnnStatus_t;
18066}
18067#[repr(u32)]
18068#[non_exhaustive]
18069#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18070pub enum cudnnBatchNormMode_t {
18071 CUDNN_BATCHNORM_PER_ACTIVATION = 0,
18072 CUDNN_BATCHNORM_SPATIAL = 1,
18073 CUDNN_BATCHNORM_SPATIAL_PERSISTENT = 2,
18074}
18075extern "C" {
18076 pub fn cudnnDeriveBNTensorDescriptor(
18077 derivedBnDesc: cudnnTensorDescriptor_t,
18078 xDesc: cudnnTensorDescriptor_t,
18079 mode: cudnnBatchNormMode_t,
18080 ) -> cudnnStatus_t;
18081}
18082#[repr(u32)]
18083#[non_exhaustive]
18084#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18085pub enum cudnnBatchNormOps_t {
18086 CUDNN_BATCHNORM_OPS_BN = 0,
18087 CUDNN_BATCHNORM_OPS_BN_ACTIVATION = 1,
18088 CUDNN_BATCHNORM_OPS_BN_ADD_ACTIVATION = 2,
18089}
18090extern "C" {
18091 pub fn cudnnBatchNormalizationForwardInference(
18092 handle: cudnnHandle_t,
18093 mode: cudnnBatchNormMode_t,
18094 alpha: *const ::libc::c_void,
18095 beta: *const ::libc::c_void,
18096 xDesc: cudnnTensorDescriptor_t,
18097 x: *const ::libc::c_void,
18098 yDesc: cudnnTensorDescriptor_t,
18099 y: *mut ::libc::c_void,
18100 bnScaleBiasMeanVarDesc: cudnnTensorDescriptor_t,
18101 bnScale: *const ::libc::c_void,
18102 bnBias: *const ::libc::c_void,
18103 estimatedMean: *const ::libc::c_void,
18104 estimatedVariance: *const ::libc::c_void,
18105 epsilon: f64,
18106 ) -> cudnnStatus_t;
18107}
18108#[repr(u32)]
18109#[non_exhaustive]
18110#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18111pub enum cudnnNormMode_t {
18112 CUDNN_NORM_PER_ACTIVATION = 0,
18113 CUDNN_NORM_PER_CHANNEL = 1,
18114}
18115#[repr(u32)]
18116#[non_exhaustive]
18117#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18118pub enum cudnnNormAlgo_t {
18119 CUDNN_NORM_ALGO_STANDARD = 0,
18120 CUDNN_NORM_ALGO_PERSIST = 1,
18121}
18122extern "C" {
18123 pub fn cudnnDeriveNormTensorDescriptor(
18124 derivedNormScaleBiasDesc: cudnnTensorDescriptor_t,
18125 derivedNormMeanVarDesc: cudnnTensorDescriptor_t,
18126 xDesc: cudnnTensorDescriptor_t,
18127 mode: cudnnNormMode_t,
18128 groupCnt: ::libc::c_int,
18129 ) -> cudnnStatus_t;
18130}
18131#[repr(u32)]
18132#[non_exhaustive]
18133#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18134pub enum cudnnNormOps_t {
18135 CUDNN_NORM_OPS_NORM = 0,
18136 CUDNN_NORM_OPS_NORM_ACTIVATION = 1,
18137 CUDNN_NORM_OPS_NORM_ADD_ACTIVATION = 2,
18138}
18139extern "C" {
18140 pub fn cudnnNormalizationForwardInference(
18141 handle: cudnnHandle_t,
18142 mode: cudnnNormMode_t,
18143 normOps: cudnnNormOps_t,
18144 algo: cudnnNormAlgo_t,
18145 alpha: *const ::libc::c_void,
18146 beta: *const ::libc::c_void,
18147 xDesc: cudnnTensorDescriptor_t,
18148 x: *const ::libc::c_void,
18149 normScaleBiasDesc: cudnnTensorDescriptor_t,
18150 normScale: *const ::libc::c_void,
18151 normBias: *const ::libc::c_void,
18152 normMeanVarDesc: cudnnTensorDescriptor_t,
18153 estimatedMean: *const ::libc::c_void,
18154 estimatedVariance: *const ::libc::c_void,
18155 zDesc: cudnnTensorDescriptor_t,
18156 z: *const ::libc::c_void,
18157 activationDesc: cudnnActivationDescriptor_t,
18158 yDesc: cudnnTensorDescriptor_t,
18159 y: *mut ::libc::c_void,
18160 epsilon: f64,
18161 groupCnt: ::libc::c_int,
18162 ) -> cudnnStatus_t;
18163}
18164#[repr(u32)]
18165#[non_exhaustive]
18166#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18167pub enum cudnnSamplerType_t {
18168 CUDNN_SAMPLER_BILINEAR = 0,
18169}
18170extern "C" {
18171 pub fn cudnnCreateSpatialTransformerDescriptor(
18172 stDesc: *mut cudnnSpatialTransformerDescriptor_t,
18173 ) -> cudnnStatus_t;
18174}
18175extern "C" {
18176 pub fn cudnnSetSpatialTransformerNdDescriptor(
18177 stDesc: cudnnSpatialTransformerDescriptor_t,
18178 samplerType: cudnnSamplerType_t,
18179 dataType: cudnnDataType_t,
18180 nbDims: ::libc::c_int,
18181 dimA: *const ::libc::c_int,
18182 ) -> cudnnStatus_t;
18183}
18184extern "C" {
18185 pub fn cudnnDestroySpatialTransformerDescriptor(
18186 stDesc: cudnnSpatialTransformerDescriptor_t,
18187 ) -> cudnnStatus_t;
18188}
18189extern "C" {
18190 pub fn cudnnSpatialTfGridGeneratorForward(
18191 handle: cudnnHandle_t,
18192 stDesc: cudnnSpatialTransformerDescriptor_t,
18193 theta: *const ::libc::c_void,
18194 grid: *mut ::libc::c_void,
18195 ) -> cudnnStatus_t;
18196}
18197extern "C" {
18198 pub fn cudnnSpatialTfSamplerForward(
18199 handle: cudnnHandle_t,
18200 stDesc: cudnnSpatialTransformerDescriptor_t,
18201 alpha: *const ::libc::c_void,
18202 xDesc: cudnnTensorDescriptor_t,
18203 x: *const ::libc::c_void,
18204 grid: *const ::libc::c_void,
18205 beta: *const ::libc::c_void,
18206 yDesc: cudnnTensorDescriptor_t,
18207 y: *mut ::libc::c_void,
18208 ) -> cudnnStatus_t;
18209}
18210#[repr(C)]
18211#[derive(Debug, Copy, Clone)]
18212pub struct cudnnDropoutStruct {
18213 _unused: [u8; 0],
18214}
18215pub type cudnnDropoutDescriptor_t = *mut cudnnDropoutStruct;
18216extern "C" {
18217 pub fn cudnnCreateDropoutDescriptor(
18218 dropoutDesc: *mut cudnnDropoutDescriptor_t,
18219 ) -> cudnnStatus_t;
18220}
18221extern "C" {
18222 pub fn cudnnDestroyDropoutDescriptor(dropoutDesc: cudnnDropoutDescriptor_t) -> cudnnStatus_t;
18223}
18224extern "C" {
18225 pub fn cudnnDropoutGetStatesSize(
18226 handle: cudnnHandle_t,
18227 sizeInBytes: *mut usize,
18228 ) -> cudnnStatus_t;
18229}
18230extern "C" {
18231 pub fn cudnnDropoutGetReserveSpaceSize(
18232 xdesc: cudnnTensorDescriptor_t,
18233 sizeInBytes: *mut usize,
18234 ) -> cudnnStatus_t;
18235}
18236extern "C" {
18237 pub fn cudnnSetDropoutDescriptor(
18238 dropoutDesc: cudnnDropoutDescriptor_t,
18239 handle: cudnnHandle_t,
18240 dropout: f32,
18241 states: *mut ::libc::c_void,
18242 stateSizeInBytes: usize,
18243 seed: ::libc::c_ulonglong,
18244 ) -> cudnnStatus_t;
18245}
18246extern "C" {
18247 pub fn cudnnRestoreDropoutDescriptor(
18248 dropoutDesc: cudnnDropoutDescriptor_t,
18249 handle: cudnnHandle_t,
18250 dropout: f32,
18251 states: *mut ::libc::c_void,
18252 stateSizeInBytes: usize,
18253 seed: ::libc::c_ulonglong,
18254 ) -> cudnnStatus_t;
18255}
18256extern "C" {
18257 pub fn cudnnGetDropoutDescriptor(
18258 dropoutDesc: cudnnDropoutDescriptor_t,
18259 handle: cudnnHandle_t,
18260 dropout: *mut f32,
18261 states: *mut *mut ::libc::c_void,
18262 seed: *mut ::libc::c_ulonglong,
18263 ) -> cudnnStatus_t;
18264}
18265extern "C" {
18266 pub fn cudnnDropoutForward(
18267 handle: cudnnHandle_t,
18268 dropoutDesc: cudnnDropoutDescriptor_t,
18269 xdesc: cudnnTensorDescriptor_t,
18270 x: *const ::libc::c_void,
18271 ydesc: cudnnTensorDescriptor_t,
18272 y: *mut ::libc::c_void,
18273 reserveSpace: *mut ::libc::c_void,
18274 reserveSpaceSizeInBytes: usize,
18275 ) -> cudnnStatus_t;
18276}
18277#[repr(C)]
18278#[derive(Debug, Copy, Clone)]
18279pub struct cudnnAlgorithmStruct {
18280 _unused: [u8; 0],
18281}
18282pub type cudnnAlgorithmDescriptor_t = *mut cudnnAlgorithmStruct;
18283#[repr(C)]
18284#[derive(Debug, Copy, Clone)]
18285pub struct cudnnAlgorithmPerformanceStruct {
18286 _unused: [u8; 0],
18287}
18288pub type cudnnAlgorithmPerformance_t = *mut cudnnAlgorithmPerformanceStruct;
18289#[repr(u32)]
18290#[non_exhaustive]
18291#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18292pub enum cudnnConvolutionFwdAlgo_t {
18293 CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM = 0,
18294 CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM = 1,
18295 CUDNN_CONVOLUTION_FWD_ALGO_GEMM = 2,
18296 CUDNN_CONVOLUTION_FWD_ALGO_DIRECT = 3,
18297 CUDNN_CONVOLUTION_FWD_ALGO_FFT = 4,
18298 CUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING = 5,
18299 CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD = 6,
18300 CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED = 7,
18301 CUDNN_CONVOLUTION_FWD_ALGO_COUNT = 8,
18302}
18303#[repr(u32)]
18304#[non_exhaustive]
18305#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18306pub enum cudnnConvolutionBwdFilterAlgo_t {
18307 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_0 = 0,
18308 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1 = 1,
18309 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT = 2,
18310 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3 = 3,
18311 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD = 4,
18312 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED = 5,
18313 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING = 6,
18314 CUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT = 7,
18315}
18316#[repr(u32)]
18317#[non_exhaustive]
18318#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18319pub enum cudnnConvolutionBwdDataAlgo_t {
18320 CUDNN_CONVOLUTION_BWD_DATA_ALGO_0 = 0,
18321 CUDNN_CONVOLUTION_BWD_DATA_ALGO_1 = 1,
18322 CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT = 2,
18323 CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING = 3,
18324 CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD = 4,
18325 CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED = 5,
18326 CUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT = 6,
18327}
18328#[repr(u32)]
18329#[non_exhaustive]
18330#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18331pub enum cudnnRNNAlgo_t {
18332 CUDNN_RNN_ALGO_STANDARD = 0,
18333 CUDNN_RNN_ALGO_PERSIST_STATIC = 1,
18334 CUDNN_RNN_ALGO_PERSIST_DYNAMIC = 2,
18335 CUDNN_RNN_ALGO_PERSIST_STATIC_SMALL_H = 3,
18336 CUDNN_RNN_ALGO_COUNT = 4,
18337}
18338#[repr(u32)]
18339#[non_exhaustive]
18340#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18341pub enum cudnnCTCLossAlgo_t {
18342 CUDNN_CTC_LOSS_ALGO_DETERMINISTIC = 0,
18343 CUDNN_CTC_LOSS_ALGO_NON_DETERMINISTIC = 1,
18344}
18345#[repr(C)]
18346#[derive(Copy, Clone)]
18347pub struct cudnnAlgorithmUnionStruct {
18348 pub algo: cudnnAlgorithmUnionStruct_Algorithm,
18349}
18350#[repr(C)]
18351#[derive(Copy, Clone)]
18352pub union cudnnAlgorithmUnionStruct_Algorithm {
18353 pub convFwdAlgo: cudnnConvolutionFwdAlgo_t,
18354 pub convBwdFilterAlgo: cudnnConvolutionBwdFilterAlgo_t,
18355 pub convBwdDataAlgo: cudnnConvolutionBwdDataAlgo_t,
18356 pub RNNAlgo: cudnnRNNAlgo_t,
18357 pub CTCLossAlgo: cudnnCTCLossAlgo_t,
18358}
18359#[test]
18360fn bindgen_test_layout_cudnnAlgorithmUnionStruct_Algorithm() {
18361 assert_eq!(
18362 ::std::mem::size_of::<cudnnAlgorithmUnionStruct_Algorithm>(),
18363 4usize,
18364 concat!("Size of: ", stringify!(cudnnAlgorithmUnionStruct_Algorithm))
18365 );
18366 assert_eq!(
18367 ::std::mem::align_of::<cudnnAlgorithmUnionStruct_Algorithm>(),
18368 4usize,
18369 concat!(
18370 "Alignment of ",
18371 stringify!(cudnnAlgorithmUnionStruct_Algorithm)
18372 )
18373 );
18374 assert_eq!(
18375 unsafe {
18376 &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct_Algorithm>())).convFwdAlgo as *const _
18377 as usize
18378 },
18379 0usize,
18380 concat!(
18381 "Offset of field: ",
18382 stringify!(cudnnAlgorithmUnionStruct_Algorithm),
18383 "::",
18384 stringify!(convFwdAlgo)
18385 )
18386 );
18387 assert_eq!(
18388 unsafe {
18389 &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct_Algorithm>())).convBwdFilterAlgo
18390 as *const _ as usize
18391 },
18392 0usize,
18393 concat!(
18394 "Offset of field: ",
18395 stringify!(cudnnAlgorithmUnionStruct_Algorithm),
18396 "::",
18397 stringify!(convBwdFilterAlgo)
18398 )
18399 );
18400 assert_eq!(
18401 unsafe {
18402 &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct_Algorithm>())).convBwdDataAlgo
18403 as *const _ as usize
18404 },
18405 0usize,
18406 concat!(
18407 "Offset of field: ",
18408 stringify!(cudnnAlgorithmUnionStruct_Algorithm),
18409 "::",
18410 stringify!(convBwdDataAlgo)
18411 )
18412 );
18413 assert_eq!(
18414 unsafe {
18415 &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct_Algorithm>())).RNNAlgo as *const _
18416 as usize
18417 },
18418 0usize,
18419 concat!(
18420 "Offset of field: ",
18421 stringify!(cudnnAlgorithmUnionStruct_Algorithm),
18422 "::",
18423 stringify!(RNNAlgo)
18424 )
18425 );
18426 assert_eq!(
18427 unsafe {
18428 &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct_Algorithm>())).CTCLossAlgo as *const _
18429 as usize
18430 },
18431 0usize,
18432 concat!(
18433 "Offset of field: ",
18434 stringify!(cudnnAlgorithmUnionStruct_Algorithm),
18435 "::",
18436 stringify!(CTCLossAlgo)
18437 )
18438 );
18439}
18440#[test]
18441fn bindgen_test_layout_cudnnAlgorithmUnionStruct() {
18442 assert_eq!(
18443 ::std::mem::size_of::<cudnnAlgorithmUnionStruct>(),
18444 4usize,
18445 concat!("Size of: ", stringify!(cudnnAlgorithmUnionStruct))
18446 );
18447 assert_eq!(
18448 ::std::mem::align_of::<cudnnAlgorithmUnionStruct>(),
18449 4usize,
18450 concat!("Alignment of ", stringify!(cudnnAlgorithmUnionStruct))
18451 );
18452 assert_eq!(
18453 unsafe { &(*(::std::ptr::null::<cudnnAlgorithmUnionStruct>())).algo as *const _ as usize },
18454 0usize,
18455 concat!(
18456 "Offset of field: ",
18457 stringify!(cudnnAlgorithmUnionStruct),
18458 "::",
18459 stringify!(algo)
18460 )
18461 );
18462}
18463pub type cudnnAlgorithm_t = cudnnAlgorithmUnionStruct;
18464extern "C" {
18465 pub fn cudnnCreateAlgorithmDescriptor(
18466 algoDesc: *mut cudnnAlgorithmDescriptor_t,
18467 ) -> cudnnStatus_t;
18468}
18469extern "C" {
18470 pub fn cudnnSetAlgorithmDescriptor(
18471 algoDesc: cudnnAlgorithmDescriptor_t,
18472 algorithm: cudnnAlgorithm_t,
18473 ) -> cudnnStatus_t;
18474}
18475extern "C" {
18476 pub fn cudnnGetAlgorithmDescriptor(
18477 algoDesc: cudnnAlgorithmDescriptor_t,
18478 algorithm: *mut cudnnAlgorithm_t,
18479 ) -> cudnnStatus_t;
18480}
18481extern "C" {
18482 pub fn cudnnCopyAlgorithmDescriptor(
18483 src: cudnnAlgorithmDescriptor_t,
18484 dest: cudnnAlgorithmDescriptor_t,
18485 ) -> cudnnStatus_t;
18486}
18487extern "C" {
18488 pub fn cudnnDestroyAlgorithmDescriptor(algoDesc: cudnnAlgorithmDescriptor_t) -> cudnnStatus_t;
18489}
18490extern "C" {
18491 pub fn cudnnCreateAlgorithmPerformance(
18492 algoPerf: *mut cudnnAlgorithmPerformance_t,
18493 numberToCreate: ::libc::c_int,
18494 ) -> cudnnStatus_t;
18495}
18496extern "C" {
18497 pub fn cudnnSetAlgorithmPerformance(
18498 algoPerf: cudnnAlgorithmPerformance_t,
18499 algoDesc: cudnnAlgorithmDescriptor_t,
18500 status: cudnnStatus_t,
18501 time: f32,
18502 memory: usize,
18503 ) -> cudnnStatus_t;
18504}
18505extern "C" {
18506 pub fn cudnnGetAlgorithmPerformance(
18507 algoPerf: cudnnAlgorithmPerformance_t,
18508 algoDesc: *mut cudnnAlgorithmDescriptor_t,
18509 status: *mut cudnnStatus_t,
18510 time: *mut f32,
18511 memory: *mut usize,
18512 ) -> cudnnStatus_t;
18513}
18514extern "C" {
18515 pub fn cudnnDestroyAlgorithmPerformance(
18516 algoPerf: *mut cudnnAlgorithmPerformance_t,
18517 numberToDestroy: ::libc::c_int,
18518 ) -> cudnnStatus_t;
18519}
18520extern "C" {
18521 pub fn cudnnGetAlgorithmSpaceSize(
18522 handle: cudnnHandle_t,
18523 algoDesc: cudnnAlgorithmDescriptor_t,
18524 algoSpaceSizeInBytes: *mut usize,
18525 ) -> cudnnStatus_t;
18526}
18527extern "C" {
18528 pub fn cudnnSaveAlgorithm(
18529 handle: cudnnHandle_t,
18530 algoDesc: cudnnAlgorithmDescriptor_t,
18531 algoSpace: *mut ::libc::c_void,
18532 algoSpaceSizeInBytes: usize,
18533 ) -> cudnnStatus_t;
18534}
18535extern "C" {
18536 pub fn cudnnRestoreAlgorithm(
18537 handle: cudnnHandle_t,
18538 algoSpace: *mut ::libc::c_void,
18539 algoSpaceSizeInBytes: usize,
18540 algoDesc: cudnnAlgorithmDescriptor_t,
18541 ) -> cudnnStatus_t;
18542}
18543#[repr(u32)]
18544#[non_exhaustive]
18545#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
18546pub enum cudnnSeverity_t {
18547 CUDNN_SEV_FATAL = 0,
18548 CUDNN_SEV_ERROR = 1,
18549 CUDNN_SEV_WARNING = 2,
18550 CUDNN_SEV_INFO = 3,
18551}
18552#[repr(C)]
18553#[derive(Debug, Copy, Clone)]
18554pub struct cudnnDebugStruct {
18555 pub cudnn_version: ::libc::c_uint,
18556 pub cudnnStatus: cudnnStatus_t,
18557 pub time_sec: ::libc::c_uint,
18558 pub time_usec: ::libc::c_uint,
18559 pub time_delta: ::libc::c_uint,
18560 pub handle: cudnnHandle_t,
18561 pub stream: cudaStream_t,
18562 pub pid: ::libc::c_ulonglong,
18563 pub tid: ::libc::c_ulonglong,
18564 pub cudaDeviceId: ::libc::c_int,
18565 pub reserved: [::libc::c_int; 15usize],
18566}
18567#[test]
18568fn bindgen_test_layout_cudnnDebugStruct() {
18569 assert_eq!(
18570 ::std::mem::size_of::<cudnnDebugStruct>(),
18571 120usize,
18572 concat!("Size of: ", stringify!(cudnnDebugStruct))
18573 );
18574 assert_eq!(
18575 ::std::mem::align_of::<cudnnDebugStruct>(),
18576 8usize,
18577 concat!("Alignment of ", stringify!(cudnnDebugStruct))
18578 );
18579 assert_eq!(
18580 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).cudnn_version as *const _ as usize },
18581 0usize,
18582 concat!(
18583 "Offset of field: ",
18584 stringify!(cudnnDebugStruct),
18585 "::",
18586 stringify!(cudnn_version)
18587 )
18588 );
18589 assert_eq!(
18590 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).cudnnStatus as *const _ as usize },
18591 4usize,
18592 concat!(
18593 "Offset of field: ",
18594 stringify!(cudnnDebugStruct),
18595 "::",
18596 stringify!(cudnnStatus)
18597 )
18598 );
18599 assert_eq!(
18600 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).time_sec as *const _ as usize },
18601 8usize,
18602 concat!(
18603 "Offset of field: ",
18604 stringify!(cudnnDebugStruct),
18605 "::",
18606 stringify!(time_sec)
18607 )
18608 );
18609 assert_eq!(
18610 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).time_usec as *const _ as usize },
18611 12usize,
18612 concat!(
18613 "Offset of field: ",
18614 stringify!(cudnnDebugStruct),
18615 "::",
18616 stringify!(time_usec)
18617 )
18618 );
18619 assert_eq!(
18620 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).time_delta as *const _ as usize },
18621 16usize,
18622 concat!(
18623 "Offset of field: ",
18624 stringify!(cudnnDebugStruct),
18625 "::",
18626 stringify!(time_delta)
18627 )
18628 );
18629 assert_eq!(
18630 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).handle as *const _ as usize },
18631 24usize,
18632 concat!(
18633 "Offset of field: ",
18634 stringify!(cudnnDebugStruct),
18635 "::",
18636 stringify!(handle)
18637 )
18638 );
18639 assert_eq!(
18640 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).stream as *const _ as usize },
18641 32usize,
18642 concat!(
18643 "Offset of field: ",
18644 stringify!(cudnnDebugStruct),
18645 "::",
18646 stringify!(stream)
18647 )
18648 );
18649 assert_eq!(
18650 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).pid as *const _ as usize },
18651 40usize,
18652 concat!(
18653 "Offset of field: ",
18654 stringify!(cudnnDebugStruct),
18655 "::",
18656 stringify!(pid)
18657 )
18658 );
18659 assert_eq!(
18660 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).tid as *const _ as usize },
18661 48usize,
18662 concat!(
18663 "Offset of field: ",
18664 stringify!(cudnnDebugStruct),
18665 "::",
18666 stringify!(tid)
18667 )
18668 );
18669 assert_eq!(
18670 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).cudaDeviceId as *const _ as usize },
18671 56usize,
18672 concat!(
18673 "Offset of field: ",
18674 stringify!(cudnnDebugStruct),
18675 "::",
18676 stringify!(cudaDeviceId)
18677 )
18678 );
18679 assert_eq!(
18680 unsafe { &(*(::std::ptr::null::<cudnnDebugStruct>())).reserved as *const _ as usize },
18681 60usize,
18682 concat!(
18683 "Offset of field: ",
18684 stringify!(cudnnDebugStruct),
18685 "::",
18686 stringify!(reserved)
18687 )
18688 );
18689}
18690pub type cudnnDebug_t = cudnnDebugStruct;
18691pub type cudnnCallback_t = ::std::option::Option<
18692 unsafe extern "C" fn(
18693 sev: cudnnSeverity_t,
18694 udata: *mut ::libc::c_void,
18695 dbg: *const cudnnDebug_t,
18696 msg: *const ::libc::c_char,
18697 ),
18698>;
18699extern "C" {
18700 pub fn cudnnSetCallback(
18701 mask: ::libc::c_uint,
18702 udata: *mut ::libc::c_void,
18703 fptr: cudnnCallback_t,
18704 ) -> cudnnStatus_t;
18705}
18706extern "C" {
18707 pub fn cudnnGetCallback(
18708 mask: *mut ::libc::c_uint,
18709 udata: *mut *mut ::libc::c_void,
18710 fptr: *mut cudnnCallback_t,
18711 ) -> cudnnStatus_t;
18712}
18713extern "C" {
18714 pub fn cudnnOpsInferVersionCheck() -> cudnnStatus_t;
18715}
18716extern "C" {
18717 pub fn cudnnSoftmaxBackward(
18718 handle: cudnnHandle_t,
18719 algo: cudnnSoftmaxAlgorithm_t,
18720 mode: cudnnSoftmaxMode_t,
18721 alpha: *const ::libc::c_void,
18722 yDesc: cudnnTensorDescriptor_t,
18723 y: *const ::libc::c_void,
18724 dyDesc: cudnnTensorDescriptor_t,
18725 dy: *const ::libc::c_void,
18726 beta: *const ::libc::c_void,
18727 dxDesc: cudnnTensorDescriptor_t,
18728 dx: *mut ::libc::c_void,
18729 ) -> cudnnStatus_t;
18730}
18731extern "C" {
18732 pub fn cudnnPoolingBackward(
18733 handle: cudnnHandle_t,
18734 poolingDesc: cudnnPoolingDescriptor_t,
18735 alpha: *const ::libc::c_void,
18736 yDesc: cudnnTensorDescriptor_t,
18737 y: *const ::libc::c_void,
18738 dyDesc: cudnnTensorDescriptor_t,
18739 dy: *const ::libc::c_void,
18740 xDesc: cudnnTensorDescriptor_t,
18741 x: *const ::libc::c_void,
18742 beta: *const ::libc::c_void,
18743 dxDesc: cudnnTensorDescriptor_t,
18744 dx: *mut ::libc::c_void,
18745 ) -> cudnnStatus_t;
18746}
18747extern "C" {
18748 pub fn cudnnActivationBackward(
18749 handle: cudnnHandle_t,
18750 activationDesc: cudnnActivationDescriptor_t,
18751 alpha: *const ::libc::c_void,
18752 yDesc: cudnnTensorDescriptor_t,
18753 y: *const ::libc::c_void,
18754 dyDesc: cudnnTensorDescriptor_t,
18755 dy: *const ::libc::c_void,
18756 xDesc: cudnnTensorDescriptor_t,
18757 x: *const ::libc::c_void,
18758 beta: *const ::libc::c_void,
18759 dxDesc: cudnnTensorDescriptor_t,
18760 dx: *mut ::libc::c_void,
18761 ) -> cudnnStatus_t;
18762}
18763extern "C" {
18764 pub fn cudnnLRNCrossChannelBackward(
18765 handle: cudnnHandle_t,
18766 normDesc: cudnnLRNDescriptor_t,
18767 lrnMode: cudnnLRNMode_t,
18768 alpha: *const ::libc::c_void,
18769 yDesc: cudnnTensorDescriptor_t,
18770 y: *const ::libc::c_void,
18771 dyDesc: cudnnTensorDescriptor_t,
18772 dy: *const ::libc::c_void,
18773 xDesc: cudnnTensorDescriptor_t,
18774 x: *const ::libc::c_void,
18775 beta: *const ::libc::c_void,
18776 dxDesc: cudnnTensorDescriptor_t,
18777 dx: *mut ::libc::c_void,
18778 ) -> cudnnStatus_t;
18779}
18780extern "C" {
18781 pub fn cudnnDivisiveNormalizationBackward(
18782 handle: cudnnHandle_t,
18783 normDesc: cudnnLRNDescriptor_t,
18784 mode: cudnnDivNormMode_t,
18785 alpha: *const ::libc::c_void,
18786 xDesc: cudnnTensorDescriptor_t,
18787 x: *const ::libc::c_void,
18788 means: *const ::libc::c_void,
18789 dy: *const ::libc::c_void,
18790 temp: *mut ::libc::c_void,
18791 temp2: *mut ::libc::c_void,
18792 beta: *const ::libc::c_void,
18793 dXdMeansDesc: cudnnTensorDescriptor_t,
18794 dx: *mut ::libc::c_void,
18795 dMeans: *mut ::libc::c_void,
18796 ) -> cudnnStatus_t;
18797}
18798extern "C" {
18799 pub fn cudnnGetBatchNormalizationForwardTrainingExWorkspaceSize(
18800 handle: cudnnHandle_t,
18801 mode: cudnnBatchNormMode_t,
18802 bnOps: cudnnBatchNormOps_t,
18803 xDesc: cudnnTensorDescriptor_t,
18804 zDesc: cudnnTensorDescriptor_t,
18805 yDesc: cudnnTensorDescriptor_t,
18806 bnScaleBiasMeanVarDesc: cudnnTensorDescriptor_t,
18807 activationDesc: cudnnActivationDescriptor_t,
18808 sizeInBytes: *mut usize,
18809 ) -> cudnnStatus_t;
18810}
18811extern "C" {
18812 pub fn cudnnGetBatchNormalizationBackwardExWorkspaceSize(
18813 handle: cudnnHandle_t,
18814 mode: cudnnBatchNormMode_t,
18815 bnOps: cudnnBatchNormOps_t,
18816 xDesc: cudnnTensorDescriptor_t,
18817 yDesc: cudnnTensorDescriptor_t,
18818 dyDesc: cudnnTensorDescriptor_t,
18819 dzDesc: cudnnTensorDescriptor_t,
18820 dxDesc: cudnnTensorDescriptor_t,
18821 dBnScaleBiasDesc: cudnnTensorDescriptor_t,
18822 activationDesc: cudnnActivationDescriptor_t,
18823 sizeInBytes: *mut usize,
18824 ) -> cudnnStatus_t;
18825}
18826extern "C" {
18827 pub fn cudnnGetBatchNormalizationTrainingExReserveSpaceSize(
18828 handle: cudnnHandle_t,
18829 mode: cudnnBatchNormMode_t,
18830 bnOps: cudnnBatchNormOps_t,
18831 activationDesc: cudnnActivationDescriptor_t,
18832 xDesc: cudnnTensorDescriptor_t,
18833 sizeInBytes: *mut usize,
18834 ) -> cudnnStatus_t;
18835}
18836extern "C" {
18837 pub fn cudnnBatchNormalizationForwardTraining(
18838 handle: cudnnHandle_t,
18839 mode: cudnnBatchNormMode_t,
18840 alpha: *const ::libc::c_void,
18841 beta: *const ::libc::c_void,
18842 xDesc: cudnnTensorDescriptor_t,
18843 x: *const ::libc::c_void,
18844 yDesc: cudnnTensorDescriptor_t,
18845 y: *mut ::libc::c_void,
18846 bnScaleBiasMeanVarDesc: cudnnTensorDescriptor_t,
18847 bnScale: *const ::libc::c_void,
18848 bnBias: *const ::libc::c_void,
18849 exponentialAverageFactor: f64,
18850 resultRunningMean: *mut ::libc::c_void,
18851 resultRunningVariance: *mut ::libc::c_void,
18852 epsilon: f64,
18853 resultSaveMean: *mut ::libc::c_void,
18854 resultSaveInvVariance: *mut ::libc::c_void,
18855 ) -> cudnnStatus_t;
18856}
18857extern "C" {
18858 pub fn cudnnBatchNormalizationForwardTrainingEx(
18859 handle: cudnnHandle_t,
18860 mode: cudnnBatchNormMode_t,
18861 bnOps: cudnnBatchNormOps_t,
18862 alpha: *const ::libc::c_void,
18863 beta: *const ::libc::c_void,
18864 xDesc: cudnnTensorDescriptor_t,
18865 xData: *const ::libc::c_void,
18866 zDesc: cudnnTensorDescriptor_t,
18867 zData: *const ::libc::c_void,
18868 yDesc: cudnnTensorDescriptor_t,
18869 yData: *mut ::libc::c_void,
18870 bnScaleBiasMeanVarDesc: cudnnTensorDescriptor_t,
18871 bnScale: *const ::libc::c_void,
18872 bnBias: *const ::libc::c_void,
18873 exponentialAverageFactor: f64,
18874 resultRunningMean: *mut ::libc::c_void,
18875 resultRunningVariance: *mut ::libc::c_void,
18876 epsilon: f64,
18877 resultSaveMean: *mut ::libc::c_void,
18878 resultSaveInvVariance: *mut ::libc::c_void,
18879 activationDesc: cudnnActivationDescriptor_t,
18880 workspace: *mut ::libc::c_void,
18881 workSpaceSizeInBytes: usize,
18882 reserveSpace: *mut ::libc::c_void,
18883 reserveSpaceSizeInBytes: usize,
18884 ) -> cudnnStatus_t;
18885}
18886extern "C" {
18887 pub fn cudnnBatchNormalizationBackward(
18888 handle: cudnnHandle_t,
18889 mode: cudnnBatchNormMode_t,
18890 alphaDataDiff: *const ::libc::c_void,
18891 betaDataDiff: *const ::libc::c_void,
18892 alphaParamDiff: *const ::libc::c_void,
18893 betaParamDiff: *const ::libc::c_void,
18894 xDesc: cudnnTensorDescriptor_t,
18895 x: *const ::libc::c_void,
18896 dyDesc: cudnnTensorDescriptor_t,
18897 dy: *const ::libc::c_void,
18898 dxDesc: cudnnTensorDescriptor_t,
18899 dx: *mut ::libc::c_void,
18900 dBnScaleBiasDesc: cudnnTensorDescriptor_t,
18901 bnScale: *const ::libc::c_void,
18902 dBnScaleResult: *mut ::libc::c_void,
18903 dBnBiasResult: *mut ::libc::c_void,
18904 epsilon: f64,
18905 savedMean: *const ::libc::c_void,
18906 savedInvVariance: *const ::libc::c_void,
18907 ) -> cudnnStatus_t;
18908}
18909extern "C" {
18910 pub fn cudnnBatchNormalizationBackwardEx(
18911 handle: cudnnHandle_t,
18912 mode: cudnnBatchNormMode_t,
18913 bnOps: cudnnBatchNormOps_t,
18914 alphaDataDiff: *const ::libc::c_void,
18915 betaDataDiff: *const ::libc::c_void,
18916 alphaParamDiff: *const ::libc::c_void,
18917 betaParamDiff: *const ::libc::c_void,
18918 xDesc: cudnnTensorDescriptor_t,
18919 xData: *const ::libc::c_void,
18920 yDesc: cudnnTensorDescriptor_t,
18921 yData: *const ::libc::c_void,
18922 dyDesc: cudnnTensorDescriptor_t,
18923 dyData: *const ::libc::c_void,
18924 dzDesc: cudnnTensorDescriptor_t,
18925 dzData: *mut ::libc::c_void,
18926 dxDesc: cudnnTensorDescriptor_t,
18927 dxData: *mut ::libc::c_void,
18928 dBnScaleBiasDesc: cudnnTensorDescriptor_t,
18929 bnScaleData: *const ::libc::c_void,
18930 bnBiasData: *const ::libc::c_void,
18931 dBnScaleData: *mut ::libc::c_void,
18932 dBnBiasData: *mut ::libc::c_void,
18933 epsilon: f64,
18934 savedMean: *const ::libc::c_void,
18935 savedInvVariance: *const ::libc::c_void,
18936 activationDesc: cudnnActivationDescriptor_t,
18937 workSpace: *mut ::libc::c_void,
18938 workSpaceSizeInBytes: usize,
18939 reserveSpace: *mut ::libc::c_void,
18940 reserveSpaceSizeInBytes: usize,
18941 ) -> cudnnStatus_t;
18942}
18943extern "C" {
18944 pub fn cudnnGetNormalizationForwardTrainingWorkspaceSize(
18945 handle: cudnnHandle_t,
18946 mode: cudnnNormMode_t,
18947 normOps: cudnnNormOps_t,
18948 algo: cudnnNormAlgo_t,
18949 xDesc: cudnnTensorDescriptor_t,
18950 zDesc: cudnnTensorDescriptor_t,
18951 yDesc: cudnnTensorDescriptor_t,
18952 normScaleBiasDesc: cudnnTensorDescriptor_t,
18953 activationDesc: cudnnActivationDescriptor_t,
18954 normMeanVarDesc: cudnnTensorDescriptor_t,
18955 sizeInBytes: *mut usize,
18956 groupCnt: ::libc::c_int,
18957 ) -> cudnnStatus_t;
18958}
18959extern "C" {
18960 pub fn cudnnGetNormalizationBackwardWorkspaceSize(
18961 handle: cudnnHandle_t,
18962 mode: cudnnNormMode_t,
18963 normOps: cudnnNormOps_t,
18964 algo: cudnnNormAlgo_t,
18965 xDesc: cudnnTensorDescriptor_t,
18966 yDesc: cudnnTensorDescriptor_t,
18967 dyDesc: cudnnTensorDescriptor_t,
18968 dzDesc: cudnnTensorDescriptor_t,
18969 dxDesc: cudnnTensorDescriptor_t,
18970 dNormScaleBiasDesc: cudnnTensorDescriptor_t,
18971 activationDesc: cudnnActivationDescriptor_t,
18972 normMeanVarDesc: cudnnTensorDescriptor_t,
18973 sizeInBytes: *mut usize,
18974 groupCnt: ::libc::c_int,
18975 ) -> cudnnStatus_t;
18976}
18977extern "C" {
18978 pub fn cudnnGetNormalizationTrainingReserveSpaceSize(
18979 handle: cudnnHandle_t,
18980 mode: cudnnNormMode_t,
18981 normOps: cudnnNormOps_t,
18982 algo: cudnnNormAlgo_t,
18983 activationDesc: cudnnActivationDescriptor_t,
18984 xDesc: cudnnTensorDescriptor_t,
18985 sizeInBytes: *mut usize,
18986 groupCnt: ::libc::c_int,
18987 ) -> cudnnStatus_t;
18988}
18989extern "C" {
18990 pub fn cudnnNormalizationForwardTraining(
18991 handle: cudnnHandle_t,
18992 mode: cudnnNormMode_t,
18993 normOps: cudnnNormOps_t,
18994 algo: cudnnNormAlgo_t,
18995 alpha: *const ::libc::c_void,
18996 beta: *const ::libc::c_void,
18997 xDesc: cudnnTensorDescriptor_t,
18998 xData: *const ::libc::c_void,
18999 normScaleBiasDesc: cudnnTensorDescriptor_t,
19000 normScale: *const ::libc::c_void,
19001 normBias: *const ::libc::c_void,
19002 exponentialAverageFactor: f64,
19003 normMeanVarDesc: cudnnTensorDescriptor_t,
19004 resultRunningMean: *mut ::libc::c_void,
19005 resultRunningVariance: *mut ::libc::c_void,
19006 epsilon: f64,
19007 resultSaveMean: *mut ::libc::c_void,
19008 resultSaveInvVariance: *mut ::libc::c_void,
19009 activationDesc: cudnnActivationDescriptor_t,
19010 zDesc: cudnnTensorDescriptor_t,
19011 zData: *const ::libc::c_void,
19012 yDesc: cudnnTensorDescriptor_t,
19013 yData: *mut ::libc::c_void,
19014 workspace: *mut ::libc::c_void,
19015 workSpaceSizeInBytes: usize,
19016 reserveSpace: *mut ::libc::c_void,
19017 reserveSpaceSizeInBytes: usize,
19018 groupCnt: ::libc::c_int,
19019 ) -> cudnnStatus_t;
19020}
19021extern "C" {
19022 pub fn cudnnNormalizationBackward(
19023 handle: cudnnHandle_t,
19024 mode: cudnnNormMode_t,
19025 normOps: cudnnNormOps_t,
19026 algo: cudnnNormAlgo_t,
19027 alphaDataDiff: *const ::libc::c_void,
19028 betaDataDiff: *const ::libc::c_void,
19029 alphaParamDiff: *const ::libc::c_void,
19030 betaParamDiff: *const ::libc::c_void,
19031 xDesc: cudnnTensorDescriptor_t,
19032 xData: *const ::libc::c_void,
19033 yDesc: cudnnTensorDescriptor_t,
19034 yData: *const ::libc::c_void,
19035 dyDesc: cudnnTensorDescriptor_t,
19036 dyData: *const ::libc::c_void,
19037 dzDesc: cudnnTensorDescriptor_t,
19038 dzData: *mut ::libc::c_void,
19039 dxDesc: cudnnTensorDescriptor_t,
19040 dxData: *mut ::libc::c_void,
19041 dNormScaleBiasDesc: cudnnTensorDescriptor_t,
19042 normScaleData: *const ::libc::c_void,
19043 normBiasData: *const ::libc::c_void,
19044 dNormScaleData: *mut ::libc::c_void,
19045 dNormBiasData: *mut ::libc::c_void,
19046 epsilon: f64,
19047 normMeanVarDesc: cudnnTensorDescriptor_t,
19048 savedMean: *const ::libc::c_void,
19049 savedInvVariance: *const ::libc::c_void,
19050 activationDesc: cudnnActivationDescriptor_t,
19051 workSpace: *mut ::libc::c_void,
19052 workSpaceSizeInBytes: usize,
19053 reserveSpace: *mut ::libc::c_void,
19054 reserveSpaceSizeInBytes: usize,
19055 groupCnt: ::libc::c_int,
19056 ) -> cudnnStatus_t;
19057}
19058extern "C" {
19059 pub fn cudnnSpatialTfGridGeneratorBackward(
19060 handle: cudnnHandle_t,
19061 stDesc: cudnnSpatialTransformerDescriptor_t,
19062 dgrid: *const ::libc::c_void,
19063 dtheta: *mut ::libc::c_void,
19064 ) -> cudnnStatus_t;
19065}
19066extern "C" {
19067 pub fn cudnnSpatialTfSamplerBackward(
19068 handle: cudnnHandle_t,
19069 stDesc: cudnnSpatialTransformerDescriptor_t,
19070 alpha: *const ::libc::c_void,
19071 xDesc: cudnnTensorDescriptor_t,
19072 x: *const ::libc::c_void,
19073 beta: *const ::libc::c_void,
19074 dxDesc: cudnnTensorDescriptor_t,
19075 dx: *mut ::libc::c_void,
19076 alphaDgrid: *const ::libc::c_void,
19077 dyDesc: cudnnTensorDescriptor_t,
19078 dy: *const ::libc::c_void,
19079 grid: *const ::libc::c_void,
19080 betaDgrid: *const ::libc::c_void,
19081 dgrid: *mut ::libc::c_void,
19082 ) -> cudnnStatus_t;
19083}
19084extern "C" {
19085 pub fn cudnnDropoutBackward(
19086 handle: cudnnHandle_t,
19087 dropoutDesc: cudnnDropoutDescriptor_t,
19088 dydesc: cudnnTensorDescriptor_t,
19089 dy: *const ::libc::c_void,
19090 dxdesc: cudnnTensorDescriptor_t,
19091 dx: *mut ::libc::c_void,
19092 reserveSpace: *mut ::libc::c_void,
19093 reserveSpaceSizeInBytes: usize,
19094 ) -> cudnnStatus_t;
19095}
19096extern "C" {
19097 pub fn cudnnOpsTrainVersionCheck() -> cudnnStatus_t;
19098}
19099#[repr(u32)]
19100#[non_exhaustive]
19101#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19102pub enum cudnnForwardMode_t {
19103 CUDNN_FWD_MODE_INFERENCE = 0,
19104 CUDNN_FWD_MODE_TRAINING = 1,
19105}
19106#[repr(u32)]
19107#[non_exhaustive]
19108#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19109pub enum cudnnRNNMode_t {
19110 CUDNN_RNN_RELU = 0,
19111 CUDNN_RNN_TANH = 1,
19112 CUDNN_LSTM = 2,
19113 CUDNN_GRU = 3,
19114}
19115#[repr(u32)]
19116#[non_exhaustive]
19117#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19118pub enum cudnnRNNBiasMode_t {
19119 CUDNN_RNN_NO_BIAS = 0,
19120 CUDNN_RNN_SINGLE_INP_BIAS = 1,
19121 CUDNN_RNN_DOUBLE_BIAS = 2,
19122 CUDNN_RNN_SINGLE_REC_BIAS = 3,
19123}
19124#[repr(u32)]
19125#[non_exhaustive]
19126#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19127pub enum cudnnDirectionMode_t {
19128 CUDNN_UNIDIRECTIONAL = 0,
19129 CUDNN_BIDIRECTIONAL = 1,
19130}
19131#[repr(u32)]
19132#[non_exhaustive]
19133#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19134pub enum cudnnRNNInputMode_t {
19135 CUDNN_LINEAR_INPUT = 0,
19136 CUDNN_SKIP_INPUT = 1,
19137}
19138#[repr(u32)]
19139#[non_exhaustive]
19140#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19141pub enum cudnnRNNClipMode_t {
19142 CUDNN_RNN_CLIP_NONE = 0,
19143 CUDNN_RNN_CLIP_MINMAX = 1,
19144}
19145#[repr(u32)]
19146#[non_exhaustive]
19147#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19148pub enum cudnnRNNDataLayout_t {
19149 CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_UNPACKED = 0,
19150 CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED = 1,
19151 CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED = 2,
19152}
19153pub type cudnnRNNPaddingMode_t = ::libc::c_uint;
19154#[repr(C)]
19155#[derive(Debug, Copy, Clone)]
19156pub struct cudnnRNNStruct {
19157 _unused: [u8; 0],
19158}
19159pub type cudnnRNNDescriptor_t = *mut cudnnRNNStruct;
19160#[repr(C)]
19161#[derive(Debug, Copy, Clone)]
19162pub struct cudnnPersistentRNNPlan {
19163 _unused: [u8; 0],
19164}
19165pub type cudnnPersistentRNNPlan_t = *mut cudnnPersistentRNNPlan;
19166#[repr(C)]
19167#[derive(Debug, Copy, Clone)]
19168pub struct cudnnRNNDataStruct {
19169 _unused: [u8; 0],
19170}
19171pub type cudnnRNNDataDescriptor_t = *mut cudnnRNNDataStruct;
19172extern "C" {
19173 pub fn cudnnCreateRNNDescriptor(rnnDesc: *mut cudnnRNNDescriptor_t) -> cudnnStatus_t;
19174}
19175extern "C" {
19176 pub fn cudnnDestroyRNNDescriptor(rnnDesc: cudnnRNNDescriptor_t) -> cudnnStatus_t;
19177}
19178extern "C" {
19179 pub fn cudnnSetRNNDescriptor_v8(
19180 rnnDesc: cudnnRNNDescriptor_t,
19181 algo: cudnnRNNAlgo_t,
19182 cellMode: cudnnRNNMode_t,
19183 biasMode: cudnnRNNBiasMode_t,
19184 dirMode: cudnnDirectionMode_t,
19185 inputMode: cudnnRNNInputMode_t,
19186 dataType: cudnnDataType_t,
19187 mathPrec: cudnnDataType_t,
19188 mathType: cudnnMathType_t,
19189 inputSize: i32,
19190 hiddenSize: i32,
19191 projSize: i32,
19192 numLayers: i32,
19193 dropoutDesc: cudnnDropoutDescriptor_t,
19194 auxFlags: u32,
19195 ) -> cudnnStatus_t;
19196}
19197extern "C" {
19198 pub fn cudnnGetRNNDescriptor_v8(
19199 rnnDesc: cudnnRNNDescriptor_t,
19200 algo: *mut cudnnRNNAlgo_t,
19201 cellMode: *mut cudnnRNNMode_t,
19202 biasMode: *mut cudnnRNNBiasMode_t,
19203 dirMode: *mut cudnnDirectionMode_t,
19204 inputMode: *mut cudnnRNNInputMode_t,
19205 dataType: *mut cudnnDataType_t,
19206 mathPrec: *mut cudnnDataType_t,
19207 mathType: *mut cudnnMathType_t,
19208 inputSize: *mut i32,
19209 hiddenSize: *mut i32,
19210 projSize: *mut i32,
19211 numLayers: *mut i32,
19212 dropoutDesc: *mut cudnnDropoutDescriptor_t,
19213 auxFlags: *mut u32,
19214 ) -> cudnnStatus_t;
19215}
19216extern "C" {
19217 pub fn cudnnSetRNNDescriptor_v6(
19218 handle: cudnnHandle_t,
19219 rnnDesc: cudnnRNNDescriptor_t,
19220 hiddenSize: ::libc::c_int,
19221 numLayers: ::libc::c_int,
19222 dropoutDesc: cudnnDropoutDescriptor_t,
19223 inputMode: cudnnRNNInputMode_t,
19224 direction: cudnnDirectionMode_t,
19225 cellMode: cudnnRNNMode_t,
19226 algo: cudnnRNNAlgo_t,
19227 mathPrec: cudnnDataType_t,
19228 ) -> cudnnStatus_t;
19229}
19230extern "C" {
19231 pub fn cudnnGetRNNDescriptor_v6(
19232 handle: cudnnHandle_t,
19233 rnnDesc: cudnnRNNDescriptor_t,
19234 hiddenSize: *mut ::libc::c_int,
19235 numLayers: *mut ::libc::c_int,
19236 dropoutDesc: *mut cudnnDropoutDescriptor_t,
19237 inputMode: *mut cudnnRNNInputMode_t,
19238 direction: *mut cudnnDirectionMode_t,
19239 cellMode: *mut cudnnRNNMode_t,
19240 algo: *mut cudnnRNNAlgo_t,
19241 mathPrec: *mut cudnnDataType_t,
19242 ) -> cudnnStatus_t;
19243}
19244extern "C" {
19245 pub fn cudnnSetRNNMatrixMathType(
19246 rnnDesc: cudnnRNNDescriptor_t,
19247 mType: cudnnMathType_t,
19248 ) -> cudnnStatus_t;
19249}
19250extern "C" {
19251 pub fn cudnnGetRNNMatrixMathType(
19252 rnnDesc: cudnnRNNDescriptor_t,
19253 mType: *mut cudnnMathType_t,
19254 ) -> cudnnStatus_t;
19255}
19256extern "C" {
19257 pub fn cudnnSetRNNBiasMode(
19258 rnnDesc: cudnnRNNDescriptor_t,
19259 biasMode: cudnnRNNBiasMode_t,
19260 ) -> cudnnStatus_t;
19261}
19262extern "C" {
19263 pub fn cudnnGetRNNBiasMode(
19264 rnnDesc: cudnnRNNDescriptor_t,
19265 biasMode: *mut cudnnRNNBiasMode_t,
19266 ) -> cudnnStatus_t;
19267}
19268extern "C" {
19269 pub fn cudnnRNNSetClip_v8(
19270 rnnDesc: cudnnRNNDescriptor_t,
19271 clipMode: cudnnRNNClipMode_t,
19272 clipNanOpt: cudnnNanPropagation_t,
19273 lclip: f64,
19274 rclip: f64,
19275 ) -> cudnnStatus_t;
19276}
19277extern "C" {
19278 pub fn cudnnRNNGetClip_v8(
19279 rnnDesc: cudnnRNNDescriptor_t,
19280 clipMode: *mut cudnnRNNClipMode_t,
19281 clipNanOpt: *mut cudnnNanPropagation_t,
19282 lclip: *mut f64,
19283 rclip: *mut f64,
19284 ) -> cudnnStatus_t;
19285}
19286extern "C" {
19287 pub fn cudnnRNNSetClip(
19288 handle: cudnnHandle_t,
19289 rnnDesc: cudnnRNNDescriptor_t,
19290 clipMode: cudnnRNNClipMode_t,
19291 clipNanOpt: cudnnNanPropagation_t,
19292 lclip: f64,
19293 rclip: f64,
19294 ) -> cudnnStatus_t;
19295}
19296extern "C" {
19297 pub fn cudnnRNNGetClip(
19298 handle: cudnnHandle_t,
19299 rnnDesc: cudnnRNNDescriptor_t,
19300 clipMode: *mut cudnnRNNClipMode_t,
19301 clipNanOpt: *mut cudnnNanPropagation_t,
19302 lclip: *mut f64,
19303 rclip: *mut f64,
19304 ) -> cudnnStatus_t;
19305}
19306extern "C" {
19307 pub fn cudnnSetRNNProjectionLayers(
19308 handle: cudnnHandle_t,
19309 rnnDesc: cudnnRNNDescriptor_t,
19310 recProjSize: ::libc::c_int,
19311 outProjSize: ::libc::c_int,
19312 ) -> cudnnStatus_t;
19313}
19314extern "C" {
19315 pub fn cudnnGetRNNProjectionLayers(
19316 handle: cudnnHandle_t,
19317 rnnDesc: cudnnRNNDescriptor_t,
19318 recProjSize: *mut ::libc::c_int,
19319 outProjSize: *mut ::libc::c_int,
19320 ) -> cudnnStatus_t;
19321}
19322extern "C" {
19323 pub fn cudnnCreatePersistentRNNPlan(
19324 rnnDesc: cudnnRNNDescriptor_t,
19325 minibatch: ::libc::c_int,
19326 dataType: cudnnDataType_t,
19327 plan: *mut cudnnPersistentRNNPlan_t,
19328 ) -> cudnnStatus_t;
19329}
19330extern "C" {
19331 pub fn cudnnDestroyPersistentRNNPlan(plan: cudnnPersistentRNNPlan_t) -> cudnnStatus_t;
19332}
19333extern "C" {
19334 pub fn cudnnSetPersistentRNNPlan(
19335 rnnDesc: cudnnRNNDescriptor_t,
19336 plan: cudnnPersistentRNNPlan_t,
19337 ) -> cudnnStatus_t;
19338}
19339extern "C" {
19340 pub fn cudnnBuildRNNDynamic(
19341 handle: cudnnHandle_t,
19342 rnnDesc: cudnnRNNDescriptor_t,
19343 miniBatch: ::libc::c_int,
19344 ) -> cudnnStatus_t;
19345}
19346extern "C" {
19347 pub fn cudnnGetRNNWorkspaceSize(
19348 handle: cudnnHandle_t,
19349 rnnDesc: cudnnRNNDescriptor_t,
19350 seqLength: ::libc::c_int,
19351 xDesc: *const cudnnTensorDescriptor_t,
19352 sizeInBytes: *mut usize,
19353 ) -> cudnnStatus_t;
19354}
19355extern "C" {
19356 pub fn cudnnGetRNNTrainingReserveSize(
19357 handle: cudnnHandle_t,
19358 rnnDesc: cudnnRNNDescriptor_t,
19359 seqLength: ::libc::c_int,
19360 xDesc: *const cudnnTensorDescriptor_t,
19361 sizeInBytes: *mut usize,
19362 ) -> cudnnStatus_t;
19363}
19364extern "C" {
19365 pub fn cudnnGetRNNTempSpaceSizes(
19366 handle: cudnnHandle_t,
19367 rnnDesc: cudnnRNNDescriptor_t,
19368 fMode: cudnnForwardMode_t,
19369 xDesc: cudnnRNNDataDescriptor_t,
19370 workSpaceSize: *mut usize,
19371 reserveSpaceSize: *mut usize,
19372 ) -> cudnnStatus_t;
19373}
19374extern "C" {
19375 pub fn cudnnGetRNNParamsSize(
19376 handle: cudnnHandle_t,
19377 rnnDesc: cudnnRNNDescriptor_t,
19378 xDesc: cudnnTensorDescriptor_t,
19379 sizeInBytes: *mut usize,
19380 dataType: cudnnDataType_t,
19381 ) -> cudnnStatus_t;
19382}
19383extern "C" {
19384 pub fn cudnnGetRNNWeightSpaceSize(
19385 handle: cudnnHandle_t,
19386 rnnDesc: cudnnRNNDescriptor_t,
19387 weightSpaceSize: *mut usize,
19388 ) -> cudnnStatus_t;
19389}
19390extern "C" {
19391 pub fn cudnnGetRNNLinLayerMatrixParams(
19392 handle: cudnnHandle_t,
19393 rnnDesc: cudnnRNNDescriptor_t,
19394 pseudoLayer: ::libc::c_int,
19395 xDesc: cudnnTensorDescriptor_t,
19396 wDesc: cudnnFilterDescriptor_t,
19397 w: *const ::libc::c_void,
19398 linLayerID: ::libc::c_int,
19399 linLayerMatDesc: cudnnFilterDescriptor_t,
19400 linLayerMat: *mut *mut ::libc::c_void,
19401 ) -> cudnnStatus_t;
19402}
19403extern "C" {
19404 pub fn cudnnGetRNNLinLayerBiasParams(
19405 handle: cudnnHandle_t,
19406 rnnDesc: cudnnRNNDescriptor_t,
19407 pseudoLayer: ::libc::c_int,
19408 xDesc: cudnnTensorDescriptor_t,
19409 wDesc: cudnnFilterDescriptor_t,
19410 w: *const ::libc::c_void,
19411 linLayerID: ::libc::c_int,
19412 linLayerBiasDesc: cudnnFilterDescriptor_t,
19413 linLayerBias: *mut *mut ::libc::c_void,
19414 ) -> cudnnStatus_t;
19415}
19416extern "C" {
19417 pub fn cudnnGetRNNWeightParams(
19418 handle: cudnnHandle_t,
19419 rnnDesc: cudnnRNNDescriptor_t,
19420 pseudoLayer: i32,
19421 weightSpaceSize: usize,
19422 weightSpace: *const ::libc::c_void,
19423 linLayerID: i32,
19424 mDesc: cudnnTensorDescriptor_t,
19425 mAddr: *mut *mut ::libc::c_void,
19426 bDesc: cudnnTensorDescriptor_t,
19427 bAddr: *mut *mut ::libc::c_void,
19428 ) -> cudnnStatus_t;
19429}
19430extern "C" {
19431 pub fn cudnnRNNForwardInference(
19432 handle: cudnnHandle_t,
19433 rnnDesc: cudnnRNNDescriptor_t,
19434 seqLength: ::libc::c_int,
19435 xDesc: *const cudnnTensorDescriptor_t,
19436 x: *const ::libc::c_void,
19437 hxDesc: cudnnTensorDescriptor_t,
19438 hx: *const ::libc::c_void,
19439 cxDesc: cudnnTensorDescriptor_t,
19440 cx: *const ::libc::c_void,
19441 wDesc: cudnnFilterDescriptor_t,
19442 w: *const ::libc::c_void,
19443 yDesc: *const cudnnTensorDescriptor_t,
19444 y: *mut ::libc::c_void,
19445 hyDesc: cudnnTensorDescriptor_t,
19446 hy: *mut ::libc::c_void,
19447 cyDesc: cudnnTensorDescriptor_t,
19448 cy: *mut ::libc::c_void,
19449 workSpace: *mut ::libc::c_void,
19450 workSpaceSizeInBytes: usize,
19451 ) -> cudnnStatus_t;
19452}
19453extern "C" {
19454 pub fn cudnnSetRNNPaddingMode(
19455 rnnDesc: cudnnRNNDescriptor_t,
19456 paddingMode: ::libc::c_uint,
19457 ) -> cudnnStatus_t;
19458}
19459extern "C" {
19460 pub fn cudnnGetRNNPaddingMode(
19461 rnnDesc: cudnnRNNDescriptor_t,
19462 paddingMode: *mut ::libc::c_uint,
19463 ) -> cudnnStatus_t;
19464}
19465extern "C" {
19466 pub fn cudnnCreateRNNDataDescriptor(
19467 rnnDataDesc: *mut cudnnRNNDataDescriptor_t,
19468 ) -> cudnnStatus_t;
19469}
19470extern "C" {
19471 pub fn cudnnDestroyRNNDataDescriptor(rnnDataDesc: cudnnRNNDataDescriptor_t) -> cudnnStatus_t;
19472}
19473extern "C" {
19474 pub fn cudnnSetRNNDataDescriptor(
19475 rnnDataDesc: cudnnRNNDataDescriptor_t,
19476 dataType: cudnnDataType_t,
19477 layout: cudnnRNNDataLayout_t,
19478 maxSeqLength: ::libc::c_int,
19479 batchSize: ::libc::c_int,
19480 vectorSize: ::libc::c_int,
19481 seqLengthArray: *const ::libc::c_int,
19482 paddingFill: *mut ::libc::c_void,
19483 ) -> cudnnStatus_t;
19484}
19485extern "C" {
19486 pub fn cudnnGetRNNDataDescriptor(
19487 rnnDataDesc: cudnnRNNDataDescriptor_t,
19488 dataType: *mut cudnnDataType_t,
19489 layout: *mut cudnnRNNDataLayout_t,
19490 maxSeqLength: *mut ::libc::c_int,
19491 batchSize: *mut ::libc::c_int,
19492 vectorSize: *mut ::libc::c_int,
19493 arrayLengthRequested: ::libc::c_int,
19494 seqLengthArray: *mut ::libc::c_int,
19495 paddingFill: *mut ::libc::c_void,
19496 ) -> cudnnStatus_t;
19497}
19498extern "C" {
19499 pub fn cudnnRNNForwardInferenceEx(
19500 handle: cudnnHandle_t,
19501 rnnDesc: cudnnRNNDescriptor_t,
19502 xDesc: cudnnRNNDataDescriptor_t,
19503 x: *const ::libc::c_void,
19504 hxDesc: cudnnTensorDescriptor_t,
19505 hx: *const ::libc::c_void,
19506 cxDesc: cudnnTensorDescriptor_t,
19507 cx: *const ::libc::c_void,
19508 wDesc: cudnnFilterDescriptor_t,
19509 w: *const ::libc::c_void,
19510 yDesc: cudnnRNNDataDescriptor_t,
19511 y: *mut ::libc::c_void,
19512 hyDesc: cudnnTensorDescriptor_t,
19513 hy: *mut ::libc::c_void,
19514 cyDesc: cudnnTensorDescriptor_t,
19515 cy: *mut ::libc::c_void,
19516 kDesc: cudnnRNNDataDescriptor_t,
19517 keys: *const ::libc::c_void,
19518 cDesc: cudnnRNNDataDescriptor_t,
19519 cAttn: *mut ::libc::c_void,
19520 iDesc: cudnnRNNDataDescriptor_t,
19521 iAttn: *mut ::libc::c_void,
19522 qDesc: cudnnRNNDataDescriptor_t,
19523 queries: *mut ::libc::c_void,
19524 workSpace: *mut ::libc::c_void,
19525 workSpaceSizeInBytes: usize,
19526 ) -> cudnnStatus_t;
19527}
19528extern "C" {
19529 pub fn cudnnRNNForward(
19530 handle: cudnnHandle_t,
19531 rnnDesc: cudnnRNNDescriptor_t,
19532 fwdMode: cudnnForwardMode_t,
19533 devSeqLengths: *const i32,
19534 xDesc: cudnnRNNDataDescriptor_t,
19535 x: *const ::libc::c_void,
19536 yDesc: cudnnRNNDataDescriptor_t,
19537 y: *mut ::libc::c_void,
19538 hDesc: cudnnTensorDescriptor_t,
19539 hx: *const ::libc::c_void,
19540 hy: *mut ::libc::c_void,
19541 cDesc: cudnnTensorDescriptor_t,
19542 cx: *const ::libc::c_void,
19543 cy: *mut ::libc::c_void,
19544 weightSpaceSize: usize,
19545 weightSpace: *const ::libc::c_void,
19546 workSpaceSize: usize,
19547 workSpace: *mut ::libc::c_void,
19548 reserveSpaceSize: usize,
19549 reserveSpace: *mut ::libc::c_void,
19550 ) -> cudnnStatus_t;
19551}
19552extern "C" {
19553 pub fn cudnnSetRNNAlgorithmDescriptor(
19554 handle: cudnnHandle_t,
19555 rnnDesc: cudnnRNNDescriptor_t,
19556 algoDesc: cudnnAlgorithmDescriptor_t,
19557 ) -> cudnnStatus_t;
19558}
19559extern "C" {
19560 pub fn cudnnGetRNNForwardInferenceAlgorithmMaxCount(
19561 handle: cudnnHandle_t,
19562 rnnDesc: cudnnRNNDescriptor_t,
19563 count: *mut ::libc::c_int,
19564 ) -> cudnnStatus_t;
19565}
19566extern "C" {
19567 pub fn cudnnFindRNNForwardInferenceAlgorithmEx(
19568 handle: cudnnHandle_t,
19569 rnnDesc: cudnnRNNDescriptor_t,
19570 seqLength: ::libc::c_int,
19571 xDesc: *const cudnnTensorDescriptor_t,
19572 x: *const ::libc::c_void,
19573 hxDesc: cudnnTensorDescriptor_t,
19574 hx: *const ::libc::c_void,
19575 cxDesc: cudnnTensorDescriptor_t,
19576 cx: *const ::libc::c_void,
19577 wDesc: cudnnFilterDescriptor_t,
19578 w: *const ::libc::c_void,
19579 yDesc: *const cudnnTensorDescriptor_t,
19580 y: *mut ::libc::c_void,
19581 hyDesc: cudnnTensorDescriptor_t,
19582 hy: *mut ::libc::c_void,
19583 cyDesc: cudnnTensorDescriptor_t,
19584 cy: *mut ::libc::c_void,
19585 findIntensity: f32,
19586 requestedAlgoCount: ::libc::c_int,
19587 returnedAlgoCount: *mut ::libc::c_int,
19588 perfResults: *mut cudnnAlgorithmPerformance_t,
19589 workspace: *mut ::libc::c_void,
19590 workSpaceSizeInBytes: usize,
19591 ) -> cudnnStatus_t;
19592}
19593#[repr(u32)]
19594#[non_exhaustive]
19595#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19596pub enum cudnnSeqDataAxis_t {
19597 CUDNN_SEQDATA_TIME_DIM = 0,
19598 CUDNN_SEQDATA_BATCH_DIM = 1,
19599 CUDNN_SEQDATA_BEAM_DIM = 2,
19600 CUDNN_SEQDATA_VECT_DIM = 3,
19601}
19602#[repr(C)]
19603#[derive(Debug, Copy, Clone)]
19604pub struct cudnnSeqDataStruct {
19605 _unused: [u8; 0],
19606}
19607pub type cudnnSeqDataDescriptor_t = *mut cudnnSeqDataStruct;
19608extern "C" {
19609 pub fn cudnnCreateSeqDataDescriptor(
19610 seqDataDesc: *mut cudnnSeqDataDescriptor_t,
19611 ) -> cudnnStatus_t;
19612}
19613extern "C" {
19614 pub fn cudnnDestroySeqDataDescriptor(seqDataDesc: cudnnSeqDataDescriptor_t) -> cudnnStatus_t;
19615}
19616extern "C" {
19617 pub fn cudnnSetSeqDataDescriptor(
19618 seqDataDesc: cudnnSeqDataDescriptor_t,
19619 dataType: cudnnDataType_t,
19620 nbDims: ::libc::c_int,
19621 dimA: *const ::libc::c_int,
19622 axes: *const cudnnSeqDataAxis_t,
19623 seqLengthArraySize: usize,
19624 seqLengthArray: *const ::libc::c_int,
19625 paddingFill: *mut ::libc::c_void,
19626 ) -> cudnnStatus_t;
19627}
19628extern "C" {
19629 pub fn cudnnGetSeqDataDescriptor(
19630 seqDataDesc: cudnnSeqDataDescriptor_t,
19631 dataType: *mut cudnnDataType_t,
19632 nbDims: *mut ::libc::c_int,
19633 nbDimsRequested: ::libc::c_int,
19634 dimA: *mut ::libc::c_int,
19635 axes: *mut cudnnSeqDataAxis_t,
19636 seqLengthArraySize: *mut usize,
19637 seqLengthSizeRequested: usize,
19638 seqLengthArray: *mut ::libc::c_int,
19639 paddingFill: *mut ::libc::c_void,
19640 ) -> cudnnStatus_t;
19641}
19642pub type cudnnAttnQueryMap_t = ::libc::c_uint;
19643#[repr(C)]
19644#[derive(Debug, Copy, Clone)]
19645pub struct cudnnAttnStruct {
19646 _unused: [u8; 0],
19647}
19648pub type cudnnAttnDescriptor_t = *mut cudnnAttnStruct;
19649extern "C" {
19650 pub fn cudnnCreateAttnDescriptor(attnDesc: *mut cudnnAttnDescriptor_t) -> cudnnStatus_t;
19651}
19652extern "C" {
19653 pub fn cudnnDestroyAttnDescriptor(attnDesc: cudnnAttnDescriptor_t) -> cudnnStatus_t;
19654}
19655extern "C" {
19656 pub fn cudnnSetAttnDescriptor(
19657 attnDesc: cudnnAttnDescriptor_t,
19658 attnMode: ::libc::c_uint,
19659 nHeads: ::libc::c_int,
19660 smScaler: f64,
19661 dataType: cudnnDataType_t,
19662 computePrec: cudnnDataType_t,
19663 mathType: cudnnMathType_t,
19664 attnDropoutDesc: cudnnDropoutDescriptor_t,
19665 postDropoutDesc: cudnnDropoutDescriptor_t,
19666 qSize: ::libc::c_int,
19667 kSize: ::libc::c_int,
19668 vSize: ::libc::c_int,
19669 qProjSize: ::libc::c_int,
19670 kProjSize: ::libc::c_int,
19671 vProjSize: ::libc::c_int,
19672 oProjSize: ::libc::c_int,
19673 qoMaxSeqLength: ::libc::c_int,
19674 kvMaxSeqLength: ::libc::c_int,
19675 maxBatchSize: ::libc::c_int,
19676 maxBeamSize: ::libc::c_int,
19677 ) -> cudnnStatus_t;
19678}
19679extern "C" {
19680 pub fn cudnnGetAttnDescriptor(
19681 attnDesc: cudnnAttnDescriptor_t,
19682 attnMode: *mut ::libc::c_uint,
19683 nHeads: *mut ::libc::c_int,
19684 smScaler: *mut f64,
19685 dataType: *mut cudnnDataType_t,
19686 computePrec: *mut cudnnDataType_t,
19687 mathType: *mut cudnnMathType_t,
19688 attnDropoutDesc: *mut cudnnDropoutDescriptor_t,
19689 postDropoutDesc: *mut cudnnDropoutDescriptor_t,
19690 qSize: *mut ::libc::c_int,
19691 kSize: *mut ::libc::c_int,
19692 vSize: *mut ::libc::c_int,
19693 qProjSize: *mut ::libc::c_int,
19694 kProjSize: *mut ::libc::c_int,
19695 vProjSize: *mut ::libc::c_int,
19696 oProjSize: *mut ::libc::c_int,
19697 qoMaxSeqLength: *mut ::libc::c_int,
19698 kvMaxSeqLength: *mut ::libc::c_int,
19699 maxBatchSize: *mut ::libc::c_int,
19700 maxBeamSize: *mut ::libc::c_int,
19701 ) -> cudnnStatus_t;
19702}
19703extern "C" {
19704 pub fn cudnnGetMultiHeadAttnBuffers(
19705 handle: cudnnHandle_t,
19706 attnDesc: cudnnAttnDescriptor_t,
19707 weightSizeInBytes: *mut usize,
19708 workSpaceSizeInBytes: *mut usize,
19709 reserveSpaceSizeInBytes: *mut usize,
19710 ) -> cudnnStatus_t;
19711}
19712#[repr(u32)]
19713#[non_exhaustive]
19714#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19715pub enum cudnnMultiHeadAttnWeightKind_t {
19716 CUDNN_MH_ATTN_Q_WEIGHTS = 0,
19717 CUDNN_MH_ATTN_K_WEIGHTS = 1,
19718 CUDNN_MH_ATTN_V_WEIGHTS = 2,
19719 CUDNN_MH_ATTN_O_WEIGHTS = 3,
19720 CUDNN_MH_ATTN_Q_BIASES = 4,
19721 CUDNN_MH_ATTN_K_BIASES = 5,
19722 CUDNN_MH_ATTN_V_BIASES = 6,
19723 CUDNN_MH_ATTN_O_BIASES = 7,
19724}
19725extern "C" {
19726 pub fn cudnnGetMultiHeadAttnWeights(
19727 handle: cudnnHandle_t,
19728 attnDesc: cudnnAttnDescriptor_t,
19729 wKind: cudnnMultiHeadAttnWeightKind_t,
19730 weightSizeInBytes: usize,
19731 weights: *const ::libc::c_void,
19732 wDesc: cudnnTensorDescriptor_t,
19733 wAddr: *mut *mut ::libc::c_void,
19734 ) -> cudnnStatus_t;
19735}
19736extern "C" {
19737 pub fn cudnnMultiHeadAttnForward(
19738 handle: cudnnHandle_t,
19739 attnDesc: cudnnAttnDescriptor_t,
19740 currIdx: ::libc::c_int,
19741 loWinIdx: *const ::libc::c_int,
19742 hiWinIdx: *const ::libc::c_int,
19743 devSeqLengthsQO: *const ::libc::c_int,
19744 devSeqLengthsKV: *const ::libc::c_int,
19745 qDesc: cudnnSeqDataDescriptor_t,
19746 queries: *const ::libc::c_void,
19747 residuals: *const ::libc::c_void,
19748 kDesc: cudnnSeqDataDescriptor_t,
19749 keys: *const ::libc::c_void,
19750 vDesc: cudnnSeqDataDescriptor_t,
19751 values: *const ::libc::c_void,
19752 oDesc: cudnnSeqDataDescriptor_t,
19753 out: *mut ::libc::c_void,
19754 weightSizeInBytes: usize,
19755 weights: *const ::libc::c_void,
19756 workSpaceSizeInBytes: usize,
19757 workSpace: *mut ::libc::c_void,
19758 reserveSpaceSizeInBytes: usize,
19759 reserveSpace: *mut ::libc::c_void,
19760 ) -> cudnnStatus_t;
19761}
19762extern "C" {
19763 pub fn cudnnAdvInferVersionCheck() -> cudnnStatus_t;
19764}
19765#[repr(u32)]
19766#[non_exhaustive]
19767#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
19768pub enum cudnnWgradMode_t {
19769 CUDNN_WGRAD_MODE_ADD = 0,
19770 CUDNN_WGRAD_MODE_SET = 1,
19771}
19772extern "C" {
19773 pub fn cudnnRNNForwardTraining(
19774 handle: cudnnHandle_t,
19775 rnnDesc: cudnnRNNDescriptor_t,
19776 seqLength: ::libc::c_int,
19777 xDesc: *const cudnnTensorDescriptor_t,
19778 x: *const ::libc::c_void,
19779 hxDesc: cudnnTensorDescriptor_t,
19780 hx: *const ::libc::c_void,
19781 cxDesc: cudnnTensorDescriptor_t,
19782 cx: *const ::libc::c_void,
19783 wDesc: cudnnFilterDescriptor_t,
19784 w: *const ::libc::c_void,
19785 yDesc: *const cudnnTensorDescriptor_t,
19786 y: *mut ::libc::c_void,
19787 hyDesc: cudnnTensorDescriptor_t,
19788 hy: *mut ::libc::c_void,
19789 cyDesc: cudnnTensorDescriptor_t,
19790 cy: *mut ::libc::c_void,
19791 workSpace: *mut ::libc::c_void,
19792 workSpaceSizeInBytes: usize,
19793 reserveSpace: *mut ::libc::c_void,
19794 reserveSpaceSizeInBytes: usize,
19795 ) -> cudnnStatus_t;
19796}
19797extern "C" {
19798 pub fn cudnnRNNBackwardData(
19799 handle: cudnnHandle_t,
19800 rnnDesc: cudnnRNNDescriptor_t,
19801 seqLength: ::libc::c_int,
19802 yDesc: *const cudnnTensorDescriptor_t,
19803 y: *const ::libc::c_void,
19804 dyDesc: *const cudnnTensorDescriptor_t,
19805 dy: *const ::libc::c_void,
19806 dhyDesc: cudnnTensorDescriptor_t,
19807 dhy: *const ::libc::c_void,
19808 dcyDesc: cudnnTensorDescriptor_t,
19809 dcy: *const ::libc::c_void,
19810 wDesc: cudnnFilterDescriptor_t,
19811 w: *const ::libc::c_void,
19812 hxDesc: cudnnTensorDescriptor_t,
19813 hx: *const ::libc::c_void,
19814 cxDesc: cudnnTensorDescriptor_t,
19815 cx: *const ::libc::c_void,
19816 dxDesc: *const cudnnTensorDescriptor_t,
19817 dx: *mut ::libc::c_void,
19818 dhxDesc: cudnnTensorDescriptor_t,
19819 dhx: *mut ::libc::c_void,
19820 dcxDesc: cudnnTensorDescriptor_t,
19821 dcx: *mut ::libc::c_void,
19822 workSpace: *mut ::libc::c_void,
19823 workSpaceSizeInBytes: usize,
19824 reserveSpace: *mut ::libc::c_void,
19825 reserveSpaceSizeInBytes: usize,
19826 ) -> cudnnStatus_t;
19827}
19828extern "C" {
19829 pub fn cudnnRNNBackwardData_v8(
19830 handle: cudnnHandle_t,
19831 rnnDesc: cudnnRNNDescriptor_t,
19832 devSeqLengths: *const i32,
19833 yDesc: cudnnRNNDataDescriptor_t,
19834 y: *const ::libc::c_void,
19835 dy: *const ::libc::c_void,
19836 xDesc: cudnnRNNDataDescriptor_t,
19837 dx: *mut ::libc::c_void,
19838 hDesc: cudnnTensorDescriptor_t,
19839 hx: *const ::libc::c_void,
19840 dhy: *const ::libc::c_void,
19841 dhx: *mut ::libc::c_void,
19842 cDesc: cudnnTensorDescriptor_t,
19843 cx: *const ::libc::c_void,
19844 dcy: *const ::libc::c_void,
19845 dcx: *mut ::libc::c_void,
19846 weightSpaceSize: usize,
19847 weightSpace: *const ::libc::c_void,
19848 workSpaceSize: usize,
19849 workSpace: *mut ::libc::c_void,
19850 reserveSpaceSize: usize,
19851 reserveSpace: *mut ::libc::c_void,
19852 ) -> cudnnStatus_t;
19853}
19854extern "C" {
19855 pub fn cudnnRNNBackwardWeights(
19856 handle: cudnnHandle_t,
19857 rnnDesc: cudnnRNNDescriptor_t,
19858 seqLength: ::libc::c_int,
19859 xDesc: *const cudnnTensorDescriptor_t,
19860 x: *const ::libc::c_void,
19861 hxDesc: cudnnTensorDescriptor_t,
19862 hx: *const ::libc::c_void,
19863 yDesc: *const cudnnTensorDescriptor_t,
19864 y: *const ::libc::c_void,
19865 workSpace: *const ::libc::c_void,
19866 workSpaceSizeInBytes: usize,
19867 dwDesc: cudnnFilterDescriptor_t,
19868 dw: *mut ::libc::c_void,
19869 reserveSpace: *const ::libc::c_void,
19870 reserveSpaceSizeInBytes: usize,
19871 ) -> cudnnStatus_t;
19872}
19873extern "C" {
19874 pub fn cudnnRNNBackwardWeights_v8(
19875 handle: cudnnHandle_t,
19876 rnnDesc: cudnnRNNDescriptor_t,
19877 addGrad: cudnnWgradMode_t,
19878 devSeqLengths: *const i32,
19879 xDesc: cudnnRNNDataDescriptor_t,
19880 x: *const ::libc::c_void,
19881 hDesc: cudnnTensorDescriptor_t,
19882 hx: *const ::libc::c_void,
19883 yDesc: cudnnRNNDataDescriptor_t,
19884 y: *const ::libc::c_void,
19885 weightSpaceSize: usize,
19886 dweightSpace: *mut ::libc::c_void,
19887 workSpaceSize: usize,
19888 workSpace: *mut ::libc::c_void,
19889 reserveSpaceSize: usize,
19890 reserveSpace: *mut ::libc::c_void,
19891 ) -> cudnnStatus_t;
19892}
19893extern "C" {
19894 pub fn cudnnRNNForwardTrainingEx(
19895 handle: cudnnHandle_t,
19896 rnnDesc: cudnnRNNDescriptor_t,
19897 xDesc: cudnnRNNDataDescriptor_t,
19898 x: *const ::libc::c_void,
19899 hxDesc: cudnnTensorDescriptor_t,
19900 hx: *const ::libc::c_void,
19901 cxDesc: cudnnTensorDescriptor_t,
19902 cx: *const ::libc::c_void,
19903 wDesc: cudnnFilterDescriptor_t,
19904 w: *const ::libc::c_void,
19905 yDesc: cudnnRNNDataDescriptor_t,
19906 y: *mut ::libc::c_void,
19907 hyDesc: cudnnTensorDescriptor_t,
19908 hy: *mut ::libc::c_void,
19909 cyDesc: cudnnTensorDescriptor_t,
19910 cy: *mut ::libc::c_void,
19911 kDesc: cudnnRNNDataDescriptor_t,
19912 keys: *const ::libc::c_void,
19913 cDesc: cudnnRNNDataDescriptor_t,
19914 cAttn: *mut ::libc::c_void,
19915 iDesc: cudnnRNNDataDescriptor_t,
19916 iAttn: *mut ::libc::c_void,
19917 qDesc: cudnnRNNDataDescriptor_t,
19918 queries: *mut ::libc::c_void,
19919 workSpace: *mut ::libc::c_void,
19920 workSpaceSizeInBytes: usize,
19921 reserveSpace: *mut ::libc::c_void,
19922 reserveSpaceSizeInBytes: usize,
19923 ) -> cudnnStatus_t;
19924}
19925extern "C" {
19926 pub fn cudnnRNNBackwardDataEx(
19927 handle: cudnnHandle_t,
19928 rnnDesc: cudnnRNNDescriptor_t,
19929 yDesc: cudnnRNNDataDescriptor_t,
19930 y: *const ::libc::c_void,
19931 dyDesc: cudnnRNNDataDescriptor_t,
19932 dy: *const ::libc::c_void,
19933 dcDesc: cudnnRNNDataDescriptor_t,
19934 dcAttn: *const ::libc::c_void,
19935 dhyDesc: cudnnTensorDescriptor_t,
19936 dhy: *const ::libc::c_void,
19937 dcyDesc: cudnnTensorDescriptor_t,
19938 dcy: *const ::libc::c_void,
19939 wDesc: cudnnFilterDescriptor_t,
19940 w: *const ::libc::c_void,
19941 hxDesc: cudnnTensorDescriptor_t,
19942 hx: *const ::libc::c_void,
19943 cxDesc: cudnnTensorDescriptor_t,
19944 cx: *const ::libc::c_void,
19945 dxDesc: cudnnRNNDataDescriptor_t,
19946 dx: *mut ::libc::c_void,
19947 dhxDesc: cudnnTensorDescriptor_t,
19948 dhx: *mut ::libc::c_void,
19949 dcxDesc: cudnnTensorDescriptor_t,
19950 dcx: *mut ::libc::c_void,
19951 dkDesc: cudnnRNNDataDescriptor_t,
19952 dkeys: *mut ::libc::c_void,
19953 workSpace: *mut ::libc::c_void,
19954 workSpaceSizeInBytes: usize,
19955 reserveSpace: *mut ::libc::c_void,
19956 reserveSpaceSizeInBytes: usize,
19957 ) -> cudnnStatus_t;
19958}
19959extern "C" {
19960 pub fn cudnnRNNBackwardWeightsEx(
19961 handle: cudnnHandle_t,
19962 rnnDesc: cudnnRNNDescriptor_t,
19963 xDesc: cudnnRNNDataDescriptor_t,
19964 x: *const ::libc::c_void,
19965 hxDesc: cudnnTensorDescriptor_t,
19966 hx: *const ::libc::c_void,
19967 yDesc: cudnnRNNDataDescriptor_t,
19968 y: *const ::libc::c_void,
19969 workSpace: *mut ::libc::c_void,
19970 workSpaceSizeInBytes: usize,
19971 dwDesc: cudnnFilterDescriptor_t,
19972 dw: *mut ::libc::c_void,
19973 reserveSpace: *mut ::libc::c_void,
19974 reserveSpaceSizeInBytes: usize,
19975 ) -> cudnnStatus_t;
19976}
19977extern "C" {
19978 pub fn cudnnGetRNNForwardTrainingAlgorithmMaxCount(
19979 handle: cudnnHandle_t,
19980 rnnDesc: cudnnRNNDescriptor_t,
19981 count: *mut ::libc::c_int,
19982 ) -> cudnnStatus_t;
19983}
19984extern "C" {
19985 pub fn cudnnFindRNNForwardTrainingAlgorithmEx(
19986 handle: cudnnHandle_t,
19987 rnnDesc: cudnnRNNDescriptor_t,
19988 seqLength: ::libc::c_int,
19989 xDesc: *const cudnnTensorDescriptor_t,
19990 x: *const ::libc::c_void,
19991 hxDesc: cudnnTensorDescriptor_t,
19992 hx: *const ::libc::c_void,
19993 cxDesc: cudnnTensorDescriptor_t,
19994 cx: *const ::libc::c_void,
19995 wDesc: cudnnFilterDescriptor_t,
19996 w: *const ::libc::c_void,
19997 yDesc: *const cudnnTensorDescriptor_t,
19998 y: *mut ::libc::c_void,
19999 hyDesc: cudnnTensorDescriptor_t,
20000 hy: *mut ::libc::c_void,
20001 cyDesc: cudnnTensorDescriptor_t,
20002 cy: *mut ::libc::c_void,
20003 findIntensity: f32,
20004 requestedAlgoCount: ::libc::c_int,
20005 returnedAlgoCount: *mut ::libc::c_int,
20006 perfResults: *mut cudnnAlgorithmPerformance_t,
20007 workspace: *mut ::libc::c_void,
20008 workSpaceSizeInBytes: usize,
20009 reserveSpace: *mut ::libc::c_void,
20010 reserveSpaceSizeInBytes: usize,
20011 ) -> cudnnStatus_t;
20012}
20013extern "C" {
20014 pub fn cudnnGetRNNBackwardDataAlgorithmMaxCount(
20015 handle: cudnnHandle_t,
20016 rnnDesc: cudnnRNNDescriptor_t,
20017 count: *mut ::libc::c_int,
20018 ) -> cudnnStatus_t;
20019}
20020extern "C" {
20021 pub fn cudnnFindRNNBackwardDataAlgorithmEx(
20022 handle: cudnnHandle_t,
20023 rnnDesc: cudnnRNNDescriptor_t,
20024 seqLength: ::libc::c_int,
20025 yDesc: *const cudnnTensorDescriptor_t,
20026 y: *const ::libc::c_void,
20027 dyDesc: *const cudnnTensorDescriptor_t,
20028 dy: *const ::libc::c_void,
20029 dhyDesc: cudnnTensorDescriptor_t,
20030 dhy: *const ::libc::c_void,
20031 dcyDesc: cudnnTensorDescriptor_t,
20032 dcy: *const ::libc::c_void,
20033 wDesc: cudnnFilterDescriptor_t,
20034 w: *const ::libc::c_void,
20035 hxDesc: cudnnTensorDescriptor_t,
20036 hx: *const ::libc::c_void,
20037 cxDesc: cudnnTensorDescriptor_t,
20038 cx: *const ::libc::c_void,
20039 dxDesc: *const cudnnTensorDescriptor_t,
20040 dx: *mut ::libc::c_void,
20041 dhxDesc: cudnnTensorDescriptor_t,
20042 dhx: *mut ::libc::c_void,
20043 dcxDesc: cudnnTensorDescriptor_t,
20044 dcx: *mut ::libc::c_void,
20045 findIntensity: f32,
20046 requestedAlgoCount: ::libc::c_int,
20047 returnedAlgoCount: *mut ::libc::c_int,
20048 perfResults: *mut cudnnAlgorithmPerformance_t,
20049 workspace: *mut ::libc::c_void,
20050 workSpaceSizeInBytes: usize,
20051 reserveSpace: *mut ::libc::c_void,
20052 reserveSpaceSizeInBytes: usize,
20053 ) -> cudnnStatus_t;
20054}
20055extern "C" {
20056 pub fn cudnnGetRNNBackwardWeightsAlgorithmMaxCount(
20057 handle: cudnnHandle_t,
20058 rnnDesc: cudnnRNNDescriptor_t,
20059 count: *mut ::libc::c_int,
20060 ) -> cudnnStatus_t;
20061}
20062extern "C" {
20063 pub fn cudnnFindRNNBackwardWeightsAlgorithmEx(
20064 handle: cudnnHandle_t,
20065 rnnDesc: cudnnRNNDescriptor_t,
20066 seqLength: ::libc::c_int,
20067 xDesc: *const cudnnTensorDescriptor_t,
20068 x: *const ::libc::c_void,
20069 hxDesc: cudnnTensorDescriptor_t,
20070 hx: *const ::libc::c_void,
20071 yDesc: *const cudnnTensorDescriptor_t,
20072 y: *const ::libc::c_void,
20073 findIntensity: f32,
20074 requestedAlgoCount: ::libc::c_int,
20075 returnedAlgoCount: *mut ::libc::c_int,
20076 perfResults: *mut cudnnAlgorithmPerformance_t,
20077 workspace: *const ::libc::c_void,
20078 workSpaceSizeInBytes: usize,
20079 dwDesc: cudnnFilterDescriptor_t,
20080 dw: *mut ::libc::c_void,
20081 reserveSpace: *const ::libc::c_void,
20082 reserveSpaceSizeInBytes: usize,
20083 ) -> cudnnStatus_t;
20084}
20085extern "C" {
20086 pub fn cudnnMultiHeadAttnBackwardData(
20087 handle: cudnnHandle_t,
20088 attnDesc: cudnnAttnDescriptor_t,
20089 loWinIdx: *const ::libc::c_int,
20090 hiWinIdx: *const ::libc::c_int,
20091 devSeqLengthsDQDO: *const ::libc::c_int,
20092 devSeqLengthsDKDV: *const ::libc::c_int,
20093 doDesc: cudnnSeqDataDescriptor_t,
20094 dout: *const ::libc::c_void,
20095 dqDesc: cudnnSeqDataDescriptor_t,
20096 dqueries: *mut ::libc::c_void,
20097 queries: *const ::libc::c_void,
20098 dkDesc: cudnnSeqDataDescriptor_t,
20099 dkeys: *mut ::libc::c_void,
20100 keys: *const ::libc::c_void,
20101 dvDesc: cudnnSeqDataDescriptor_t,
20102 dvalues: *mut ::libc::c_void,
20103 values: *const ::libc::c_void,
20104 weightSizeInBytes: usize,
20105 weights: *const ::libc::c_void,
20106 workSpaceSizeInBytes: usize,
20107 workSpace: *mut ::libc::c_void,
20108 reserveSpaceSizeInBytes: usize,
20109 reserveSpace: *mut ::libc::c_void,
20110 ) -> cudnnStatus_t;
20111}
20112extern "C" {
20113 pub fn cudnnMultiHeadAttnBackwardWeights(
20114 handle: cudnnHandle_t,
20115 attnDesc: cudnnAttnDescriptor_t,
20116 addGrad: cudnnWgradMode_t,
20117 qDesc: cudnnSeqDataDescriptor_t,
20118 queries: *const ::libc::c_void,
20119 kDesc: cudnnSeqDataDescriptor_t,
20120 keys: *const ::libc::c_void,
20121 vDesc: cudnnSeqDataDescriptor_t,
20122 values: *const ::libc::c_void,
20123 doDesc: cudnnSeqDataDescriptor_t,
20124 dout: *const ::libc::c_void,
20125 weightSizeInBytes: usize,
20126 weights: *const ::libc::c_void,
20127 dweights: *mut ::libc::c_void,
20128 workSpaceSizeInBytes: usize,
20129 workSpace: *mut ::libc::c_void,
20130 reserveSpaceSizeInBytes: usize,
20131 reserveSpace: *mut ::libc::c_void,
20132 ) -> cudnnStatus_t;
20133}
20134#[repr(u32)]
20135#[non_exhaustive]
20136#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20137pub enum cudnnLossNormalizationMode_t {
20138 CUDNN_LOSS_NORMALIZATION_NONE = 0,
20139 CUDNN_LOSS_NORMALIZATION_SOFTMAX = 1,
20140}
20141extern "C" {
20142 pub fn cudnnCreateCTCLossDescriptor(
20143 ctcLossDesc: *mut cudnnCTCLossDescriptor_t,
20144 ) -> cudnnStatus_t;
20145}
20146extern "C" {
20147 pub fn cudnnSetCTCLossDescriptor(
20148 ctcLossDesc: cudnnCTCLossDescriptor_t,
20149 compType: cudnnDataType_t,
20150 ) -> cudnnStatus_t;
20151}
20152extern "C" {
20153 pub fn cudnnSetCTCLossDescriptorEx(
20154 ctcLossDesc: cudnnCTCLossDescriptor_t,
20155 compType: cudnnDataType_t,
20156 normMode: cudnnLossNormalizationMode_t,
20157 gradMode: cudnnNanPropagation_t,
20158 ) -> cudnnStatus_t;
20159}
20160extern "C" {
20161 pub fn cudnnSetCTCLossDescriptor_v8(
20162 ctcLossDesc: cudnnCTCLossDescriptor_t,
20163 compType: cudnnDataType_t,
20164 normMode: cudnnLossNormalizationMode_t,
20165 gradMode: cudnnNanPropagation_t,
20166 maxLabelLength: ::libc::c_int,
20167 ) -> cudnnStatus_t;
20168}
20169extern "C" {
20170 pub fn cudnnGetCTCLossDescriptor(
20171 ctcLossDesc: cudnnCTCLossDescriptor_t,
20172 compType: *mut cudnnDataType_t,
20173 ) -> cudnnStatus_t;
20174}
20175extern "C" {
20176 pub fn cudnnGetCTCLossDescriptorEx(
20177 ctcLossDesc: cudnnCTCLossDescriptor_t,
20178 compType: *mut cudnnDataType_t,
20179 normMode: *mut cudnnLossNormalizationMode_t,
20180 gradMode: *mut cudnnNanPropagation_t,
20181 ) -> cudnnStatus_t;
20182}
20183extern "C" {
20184 pub fn cudnnGetCTCLossDescriptor_v8(
20185 ctcLossDesc: cudnnCTCLossDescriptor_t,
20186 compType: *mut cudnnDataType_t,
20187 normMode: *mut cudnnLossNormalizationMode_t,
20188 gradMode: *mut cudnnNanPropagation_t,
20189 maxLabelLength: *mut ::libc::c_int,
20190 ) -> cudnnStatus_t;
20191}
20192extern "C" {
20193 pub fn cudnnDestroyCTCLossDescriptor(ctcLossDesc: cudnnCTCLossDescriptor_t) -> cudnnStatus_t;
20194}
20195extern "C" {
20196 pub fn cudnnCTCLoss(
20197 handle: cudnnHandle_t,
20198 probsDesc: cudnnTensorDescriptor_t,
20199 probs: *const ::libc::c_void,
20200 hostLabels: *const ::libc::c_int,
20201 hostLabelLengths: *const ::libc::c_int,
20202 hostInputLengths: *const ::libc::c_int,
20203 costs: *mut ::libc::c_void,
20204 gradientsDesc: cudnnTensorDescriptor_t,
20205 gradients: *mut ::libc::c_void,
20206 algo: cudnnCTCLossAlgo_t,
20207 ctcLossDesc: cudnnCTCLossDescriptor_t,
20208 workspace: *mut ::libc::c_void,
20209 workSpaceSizeInBytes: usize,
20210 ) -> cudnnStatus_t;
20211}
20212extern "C" {
20213 pub fn cudnnCTCLoss_v8(
20214 handle: cudnnHandle_t,
20215 algo: cudnnCTCLossAlgo_t,
20216 ctcLossDesc: cudnnCTCLossDescriptor_t,
20217 probsDesc: cudnnTensorDescriptor_t,
20218 probs: *const ::libc::c_void,
20219 labels: *const ::libc::c_int,
20220 labelLengths: *const ::libc::c_int,
20221 inputLengths: *const ::libc::c_int,
20222 costs: *mut ::libc::c_void,
20223 gradientsDesc: cudnnTensorDescriptor_t,
20224 gradients: *mut ::libc::c_void,
20225 workSpaceSizeInBytes: usize,
20226 workspace: *mut ::libc::c_void,
20227 ) -> cudnnStatus_t;
20228}
20229extern "C" {
20230 pub fn cudnnGetCTCLossWorkspaceSize(
20231 handle: cudnnHandle_t,
20232 probsDesc: cudnnTensorDescriptor_t,
20233 gradientsDesc: cudnnTensorDescriptor_t,
20234 labels: *const ::libc::c_int,
20235 labelLengths: *const ::libc::c_int,
20236 inputLengths: *const ::libc::c_int,
20237 algo: cudnnCTCLossAlgo_t,
20238 ctcLossDesc: cudnnCTCLossDescriptor_t,
20239 sizeInBytes: *mut usize,
20240 ) -> cudnnStatus_t;
20241}
20242extern "C" {
20243 pub fn cudnnGetCTCLossWorkspaceSize_v8(
20244 handle: cudnnHandle_t,
20245 algo: cudnnCTCLossAlgo_t,
20246 ctcLossDesc: cudnnCTCLossDescriptor_t,
20247 probsDesc: cudnnTensorDescriptor_t,
20248 gradientsDesc: cudnnTensorDescriptor_t,
20249 sizeInBytes: *mut usize,
20250 ) -> cudnnStatus_t;
20251}
20252extern "C" {
20253 pub fn cudnnAdvTrainVersionCheck() -> cudnnStatus_t;
20254}
20255#[repr(C)]
20256#[derive(Debug, Copy, Clone)]
20257pub struct cudnnConvolutionStruct {
20258 _unused: [u8; 0],
20259}
20260pub type cudnnConvolutionDescriptor_t = *mut cudnnConvolutionStruct;
20261#[repr(u32)]
20262#[non_exhaustive]
20263#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20264pub enum cudnnConvolutionMode_t {
20265 CUDNN_CONVOLUTION = 0,
20266 CUDNN_CROSS_CORRELATION = 1,
20267}
20268#[repr(u32)]
20269#[non_exhaustive]
20270#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20271pub enum cudnnReorderType_t {
20272 CUDNN_DEFAULT_REORDER = 0,
20273 CUDNN_NO_REORDER = 1,
20274}
20275#[repr(C)]
20276#[derive(Debug, Copy, Clone)]
20277pub struct cudnnConvolutionFwdAlgoPerfStruct {
20278 pub algo: cudnnConvolutionFwdAlgo_t,
20279 pub status: cudnnStatus_t,
20280 pub time: f32,
20281 pub memory: usize,
20282 pub determinism: cudnnDeterminism_t,
20283 pub mathType: cudnnMathType_t,
20284 pub reserved: [::libc::c_int; 3usize],
20285}
20286#[test]
20287fn bindgen_test_layout_cudnnConvolutionFwdAlgoPerfStruct() {
20288 assert_eq!(
20289 ::std::mem::size_of::<cudnnConvolutionFwdAlgoPerfStruct>(),
20290 48usize,
20291 concat!("Size of: ", stringify!(cudnnConvolutionFwdAlgoPerfStruct))
20292 );
20293 assert_eq!(
20294 ::std::mem::align_of::<cudnnConvolutionFwdAlgoPerfStruct>(),
20295 8usize,
20296 concat!(
20297 "Alignment of ",
20298 stringify!(cudnnConvolutionFwdAlgoPerfStruct)
20299 )
20300 );
20301 assert_eq!(
20302 unsafe {
20303 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).algo as *const _ as usize
20304 },
20305 0usize,
20306 concat!(
20307 "Offset of field: ",
20308 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20309 "::",
20310 stringify!(algo)
20311 )
20312 );
20313 assert_eq!(
20314 unsafe {
20315 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).status as *const _
20316 as usize
20317 },
20318 4usize,
20319 concat!(
20320 "Offset of field: ",
20321 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20322 "::",
20323 stringify!(status)
20324 )
20325 );
20326 assert_eq!(
20327 unsafe {
20328 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).time as *const _ as usize
20329 },
20330 8usize,
20331 concat!(
20332 "Offset of field: ",
20333 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20334 "::",
20335 stringify!(time)
20336 )
20337 );
20338 assert_eq!(
20339 unsafe {
20340 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).memory as *const _
20341 as usize
20342 },
20343 16usize,
20344 concat!(
20345 "Offset of field: ",
20346 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20347 "::",
20348 stringify!(memory)
20349 )
20350 );
20351 assert_eq!(
20352 unsafe {
20353 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).determinism as *const _
20354 as usize
20355 },
20356 24usize,
20357 concat!(
20358 "Offset of field: ",
20359 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20360 "::",
20361 stringify!(determinism)
20362 )
20363 );
20364 assert_eq!(
20365 unsafe {
20366 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).mathType as *const _
20367 as usize
20368 },
20369 28usize,
20370 concat!(
20371 "Offset of field: ",
20372 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20373 "::",
20374 stringify!(mathType)
20375 )
20376 );
20377 assert_eq!(
20378 unsafe {
20379 &(*(::std::ptr::null::<cudnnConvolutionFwdAlgoPerfStruct>())).reserved as *const _
20380 as usize
20381 },
20382 32usize,
20383 concat!(
20384 "Offset of field: ",
20385 stringify!(cudnnConvolutionFwdAlgoPerfStruct),
20386 "::",
20387 stringify!(reserved)
20388 )
20389 );
20390}
20391pub type cudnnConvolutionFwdAlgoPerf_t = cudnnConvolutionFwdAlgoPerfStruct;
20392extern "C" {
20393 pub fn cudnnCreateConvolutionDescriptor(
20394 convDesc: *mut cudnnConvolutionDescriptor_t,
20395 ) -> cudnnStatus_t;
20396}
20397extern "C" {
20398 pub fn cudnnDestroyConvolutionDescriptor(
20399 convDesc: cudnnConvolutionDescriptor_t,
20400 ) -> cudnnStatus_t;
20401}
20402extern "C" {
20403 pub fn cudnnSetConvolutionMathType(
20404 convDesc: cudnnConvolutionDescriptor_t,
20405 mathType: cudnnMathType_t,
20406 ) -> cudnnStatus_t;
20407}
20408extern "C" {
20409 pub fn cudnnGetConvolutionMathType(
20410 convDesc: cudnnConvolutionDescriptor_t,
20411 mathType: *mut cudnnMathType_t,
20412 ) -> cudnnStatus_t;
20413}
20414extern "C" {
20415 pub fn cudnnSetConvolutionGroupCount(
20416 convDesc: cudnnConvolutionDescriptor_t,
20417 groupCount: ::libc::c_int,
20418 ) -> cudnnStatus_t;
20419}
20420extern "C" {
20421 pub fn cudnnGetConvolutionGroupCount(
20422 convDesc: cudnnConvolutionDescriptor_t,
20423 groupCount: *mut ::libc::c_int,
20424 ) -> cudnnStatus_t;
20425}
20426extern "C" {
20427 pub fn cudnnSetConvolutionReorderType(
20428 convDesc: cudnnConvolutionDescriptor_t,
20429 reorderType: cudnnReorderType_t,
20430 ) -> cudnnStatus_t;
20431}
20432extern "C" {
20433 pub fn cudnnGetConvolutionReorderType(
20434 convDesc: cudnnConvolutionDescriptor_t,
20435 reorderType: *mut cudnnReorderType_t,
20436 ) -> cudnnStatus_t;
20437}
20438extern "C" {
20439 pub fn cudnnSetConvolution2dDescriptor(
20440 convDesc: cudnnConvolutionDescriptor_t,
20441 pad_h: ::libc::c_int,
20442 pad_w: ::libc::c_int,
20443 u: ::libc::c_int,
20444 v: ::libc::c_int,
20445 dilation_h: ::libc::c_int,
20446 dilation_w: ::libc::c_int,
20447 mode: cudnnConvolutionMode_t,
20448 computeType: cudnnDataType_t,
20449 ) -> cudnnStatus_t;
20450}
20451extern "C" {
20452 pub fn cudnnGetConvolution2dDescriptor(
20453 convDesc: cudnnConvolutionDescriptor_t,
20454 pad_h: *mut ::libc::c_int,
20455 pad_w: *mut ::libc::c_int,
20456 u: *mut ::libc::c_int,
20457 v: *mut ::libc::c_int,
20458 dilation_h: *mut ::libc::c_int,
20459 dilation_w: *mut ::libc::c_int,
20460 mode: *mut cudnnConvolutionMode_t,
20461 computeType: *mut cudnnDataType_t,
20462 ) -> cudnnStatus_t;
20463}
20464extern "C" {
20465 pub fn cudnnSetConvolutionNdDescriptor(
20466 convDesc: cudnnConvolutionDescriptor_t,
20467 arrayLength: ::libc::c_int,
20468 padA: *const ::libc::c_int,
20469 filterStrideA: *const ::libc::c_int,
20470 dilationA: *const ::libc::c_int,
20471 mode: cudnnConvolutionMode_t,
20472 computeType: cudnnDataType_t,
20473 ) -> cudnnStatus_t;
20474}
20475extern "C" {
20476 pub fn cudnnGetConvolutionNdDescriptor(
20477 convDesc: cudnnConvolutionDescriptor_t,
20478 arrayLengthRequested: ::libc::c_int,
20479 arrayLength: *mut ::libc::c_int,
20480 padA: *mut ::libc::c_int,
20481 strideA: *mut ::libc::c_int,
20482 dilationA: *mut ::libc::c_int,
20483 mode: *mut cudnnConvolutionMode_t,
20484 computeType: *mut cudnnDataType_t,
20485 ) -> cudnnStatus_t;
20486}
20487extern "C" {
20488 pub fn cudnnGetConvolution2dForwardOutputDim(
20489 convDesc: cudnnConvolutionDescriptor_t,
20490 inputTensorDesc: cudnnTensorDescriptor_t,
20491 filterDesc: cudnnFilterDescriptor_t,
20492 n: *mut ::libc::c_int,
20493 c: *mut ::libc::c_int,
20494 h: *mut ::libc::c_int,
20495 w: *mut ::libc::c_int,
20496 ) -> cudnnStatus_t;
20497}
20498extern "C" {
20499 pub fn cudnnGetConvolutionNdForwardOutputDim(
20500 convDesc: cudnnConvolutionDescriptor_t,
20501 inputTensorDesc: cudnnTensorDescriptor_t,
20502 filterDesc: cudnnFilterDescriptor_t,
20503 nbDims: ::libc::c_int,
20504 tensorOuputDimA: *mut ::libc::c_int,
20505 ) -> cudnnStatus_t;
20506}
20507extern "C" {
20508 pub fn cudnnGetConvolutionForwardAlgorithmMaxCount(
20509 handle: cudnnHandle_t,
20510 count: *mut ::libc::c_int,
20511 ) -> cudnnStatus_t;
20512}
20513extern "C" {
20514 pub fn cudnnGetConvolutionForwardAlgorithm_v7(
20515 handle: cudnnHandle_t,
20516 srcDesc: cudnnTensorDescriptor_t,
20517 filterDesc: cudnnFilterDescriptor_t,
20518 convDesc: cudnnConvolutionDescriptor_t,
20519 destDesc: cudnnTensorDescriptor_t,
20520 requestedAlgoCount: ::libc::c_int,
20521 returnedAlgoCount: *mut ::libc::c_int,
20522 perfResults: *mut cudnnConvolutionFwdAlgoPerf_t,
20523 ) -> cudnnStatus_t;
20524}
20525extern "C" {
20526 pub fn cudnnFindConvolutionForwardAlgorithm(
20527 handle: cudnnHandle_t,
20528 xDesc: cudnnTensorDescriptor_t,
20529 wDesc: cudnnFilterDescriptor_t,
20530 convDesc: cudnnConvolutionDescriptor_t,
20531 yDesc: cudnnTensorDescriptor_t,
20532 requestedAlgoCount: ::libc::c_int,
20533 returnedAlgoCount: *mut ::libc::c_int,
20534 perfResults: *mut cudnnConvolutionFwdAlgoPerf_t,
20535 ) -> cudnnStatus_t;
20536}
20537extern "C" {
20538 pub fn cudnnFindConvolutionForwardAlgorithmEx(
20539 handle: cudnnHandle_t,
20540 xDesc: cudnnTensorDescriptor_t,
20541 x: *const ::libc::c_void,
20542 wDesc: cudnnFilterDescriptor_t,
20543 w: *const ::libc::c_void,
20544 convDesc: cudnnConvolutionDescriptor_t,
20545 yDesc: cudnnTensorDescriptor_t,
20546 y: *mut ::libc::c_void,
20547 requestedAlgoCount: ::libc::c_int,
20548 returnedAlgoCount: *mut ::libc::c_int,
20549 perfResults: *mut cudnnConvolutionFwdAlgoPerf_t,
20550 workSpace: *mut ::libc::c_void,
20551 workSpaceSizeInBytes: usize,
20552 ) -> cudnnStatus_t;
20553}
20554extern "C" {
20555 pub fn cudnnIm2Col(
20556 handle: cudnnHandle_t,
20557 xDesc: cudnnTensorDescriptor_t,
20558 x: *const ::libc::c_void,
20559 wDesc: cudnnFilterDescriptor_t,
20560 convDesc: cudnnConvolutionDescriptor_t,
20561 colBuffer: *mut ::libc::c_void,
20562 ) -> cudnnStatus_t;
20563}
20564extern "C" {
20565 pub fn cudnnReorderFilterAndBias(
20566 handle: cudnnHandle_t,
20567 filterDesc: cudnnFilterDescriptor_t,
20568 reorderType: cudnnReorderType_t,
20569 filterData: *const ::libc::c_void,
20570 reorderedFilterData: *mut ::libc::c_void,
20571 reorderBias: ::libc::c_int,
20572 biasData: *const ::libc::c_void,
20573 reorderedBiasData: *mut ::libc::c_void,
20574 ) -> cudnnStatus_t;
20575}
20576extern "C" {
20577 pub fn cudnnGetConvolutionForwardWorkspaceSize(
20578 handle: cudnnHandle_t,
20579 xDesc: cudnnTensorDescriptor_t,
20580 wDesc: cudnnFilterDescriptor_t,
20581 convDesc: cudnnConvolutionDescriptor_t,
20582 yDesc: cudnnTensorDescriptor_t,
20583 algo: cudnnConvolutionFwdAlgo_t,
20584 sizeInBytes: *mut usize,
20585 ) -> cudnnStatus_t;
20586}
20587extern "C" {
20588 pub fn cudnnConvolutionForward(
20589 handle: cudnnHandle_t,
20590 alpha: *const ::libc::c_void,
20591 xDesc: cudnnTensorDescriptor_t,
20592 x: *const ::libc::c_void,
20593 wDesc: cudnnFilterDescriptor_t,
20594 w: *const ::libc::c_void,
20595 convDesc: cudnnConvolutionDescriptor_t,
20596 algo: cudnnConvolutionFwdAlgo_t,
20597 workSpace: *mut ::libc::c_void,
20598 workSpaceSizeInBytes: usize,
20599 beta: *const ::libc::c_void,
20600 yDesc: cudnnTensorDescriptor_t,
20601 y: *mut ::libc::c_void,
20602 ) -> cudnnStatus_t;
20603}
20604extern "C" {
20605 pub fn cudnnConvolutionBiasActivationForward(
20606 handle: cudnnHandle_t,
20607 alpha1: *const ::libc::c_void,
20608 xDesc: cudnnTensorDescriptor_t,
20609 x: *const ::libc::c_void,
20610 wDesc: cudnnFilterDescriptor_t,
20611 w: *const ::libc::c_void,
20612 convDesc: cudnnConvolutionDescriptor_t,
20613 algo: cudnnConvolutionFwdAlgo_t,
20614 workSpace: *mut ::libc::c_void,
20615 workSpaceSizeInBytes: usize,
20616 alpha2: *const ::libc::c_void,
20617 zDesc: cudnnTensorDescriptor_t,
20618 z: *const ::libc::c_void,
20619 biasDesc: cudnnTensorDescriptor_t,
20620 bias: *const ::libc::c_void,
20621 activationDesc: cudnnActivationDescriptor_t,
20622 yDesc: cudnnTensorDescriptor_t,
20623 y: *mut ::libc::c_void,
20624 ) -> cudnnStatus_t;
20625}
20626#[repr(C)]
20627#[derive(Debug, Copy, Clone)]
20628pub struct cudnnConvolutionBwdDataAlgoPerfStruct {
20629 pub algo: cudnnConvolutionBwdDataAlgo_t,
20630 pub status: cudnnStatus_t,
20631 pub time: f32,
20632 pub memory: usize,
20633 pub determinism: cudnnDeterminism_t,
20634 pub mathType: cudnnMathType_t,
20635 pub reserved: [::libc::c_int; 3usize],
20636}
20637#[test]
20638fn bindgen_test_layout_cudnnConvolutionBwdDataAlgoPerfStruct() {
20639 assert_eq!(
20640 ::std::mem::size_of::<cudnnConvolutionBwdDataAlgoPerfStruct>(),
20641 48usize,
20642 concat!(
20643 "Size of: ",
20644 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct)
20645 )
20646 );
20647 assert_eq!(
20648 ::std::mem::align_of::<cudnnConvolutionBwdDataAlgoPerfStruct>(),
20649 8usize,
20650 concat!(
20651 "Alignment of ",
20652 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct)
20653 )
20654 );
20655 assert_eq!(
20656 unsafe {
20657 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).algo as *const _
20658 as usize
20659 },
20660 0usize,
20661 concat!(
20662 "Offset of field: ",
20663 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20664 "::",
20665 stringify!(algo)
20666 )
20667 );
20668 assert_eq!(
20669 unsafe {
20670 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).status as *const _
20671 as usize
20672 },
20673 4usize,
20674 concat!(
20675 "Offset of field: ",
20676 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20677 "::",
20678 stringify!(status)
20679 )
20680 );
20681 assert_eq!(
20682 unsafe {
20683 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).time as *const _
20684 as usize
20685 },
20686 8usize,
20687 concat!(
20688 "Offset of field: ",
20689 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20690 "::",
20691 stringify!(time)
20692 )
20693 );
20694 assert_eq!(
20695 unsafe {
20696 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).memory as *const _
20697 as usize
20698 },
20699 16usize,
20700 concat!(
20701 "Offset of field: ",
20702 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20703 "::",
20704 stringify!(memory)
20705 )
20706 );
20707 assert_eq!(
20708 unsafe {
20709 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).determinism
20710 as *const _ as usize
20711 },
20712 24usize,
20713 concat!(
20714 "Offset of field: ",
20715 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20716 "::",
20717 stringify!(determinism)
20718 )
20719 );
20720 assert_eq!(
20721 unsafe {
20722 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).mathType as *const _
20723 as usize
20724 },
20725 28usize,
20726 concat!(
20727 "Offset of field: ",
20728 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20729 "::",
20730 stringify!(mathType)
20731 )
20732 );
20733 assert_eq!(
20734 unsafe {
20735 &(*(::std::ptr::null::<cudnnConvolutionBwdDataAlgoPerfStruct>())).reserved as *const _
20736 as usize
20737 },
20738 32usize,
20739 concat!(
20740 "Offset of field: ",
20741 stringify!(cudnnConvolutionBwdDataAlgoPerfStruct),
20742 "::",
20743 stringify!(reserved)
20744 )
20745 );
20746}
20747pub type cudnnConvolutionBwdDataAlgoPerf_t = cudnnConvolutionBwdDataAlgoPerfStruct;
20748extern "C" {
20749 pub fn cudnnGetConvolutionBackwardDataAlgorithmMaxCount(
20750 handle: cudnnHandle_t,
20751 count: *mut ::libc::c_int,
20752 ) -> cudnnStatus_t;
20753}
20754extern "C" {
20755 pub fn cudnnFindConvolutionBackwardDataAlgorithm(
20756 handle: cudnnHandle_t,
20757 wDesc: cudnnFilterDescriptor_t,
20758 dyDesc: cudnnTensorDescriptor_t,
20759 convDesc: cudnnConvolutionDescriptor_t,
20760 dxDesc: cudnnTensorDescriptor_t,
20761 requestedAlgoCount: ::libc::c_int,
20762 returnedAlgoCount: *mut ::libc::c_int,
20763 perfResults: *mut cudnnConvolutionBwdDataAlgoPerf_t,
20764 ) -> cudnnStatus_t;
20765}
20766extern "C" {
20767 pub fn cudnnFindConvolutionBackwardDataAlgorithmEx(
20768 handle: cudnnHandle_t,
20769 wDesc: cudnnFilterDescriptor_t,
20770 w: *const ::libc::c_void,
20771 dyDesc: cudnnTensorDescriptor_t,
20772 dy: *const ::libc::c_void,
20773 convDesc: cudnnConvolutionDescriptor_t,
20774 dxDesc: cudnnTensorDescriptor_t,
20775 dx: *mut ::libc::c_void,
20776 requestedAlgoCount: ::libc::c_int,
20777 returnedAlgoCount: *mut ::libc::c_int,
20778 perfResults: *mut cudnnConvolutionBwdDataAlgoPerf_t,
20779 workSpace: *mut ::libc::c_void,
20780 workSpaceSizeInBytes: usize,
20781 ) -> cudnnStatus_t;
20782}
20783extern "C" {
20784 pub fn cudnnGetConvolutionBackwardDataAlgorithm_v7(
20785 handle: cudnnHandle_t,
20786 filterDesc: cudnnFilterDescriptor_t,
20787 diffDesc: cudnnTensorDescriptor_t,
20788 convDesc: cudnnConvolutionDescriptor_t,
20789 gradDesc: cudnnTensorDescriptor_t,
20790 requestedAlgoCount: ::libc::c_int,
20791 returnedAlgoCount: *mut ::libc::c_int,
20792 perfResults: *mut cudnnConvolutionBwdDataAlgoPerf_t,
20793 ) -> cudnnStatus_t;
20794}
20795extern "C" {
20796 pub fn cudnnGetConvolutionBackwardDataWorkspaceSize(
20797 handle: cudnnHandle_t,
20798 wDesc: cudnnFilterDescriptor_t,
20799 dyDesc: cudnnTensorDescriptor_t,
20800 convDesc: cudnnConvolutionDescriptor_t,
20801 dxDesc: cudnnTensorDescriptor_t,
20802 algo: cudnnConvolutionBwdDataAlgo_t,
20803 sizeInBytes: *mut usize,
20804 ) -> cudnnStatus_t;
20805}
20806extern "C" {
20807 pub fn cudnnConvolutionBackwardData(
20808 handle: cudnnHandle_t,
20809 alpha: *const ::libc::c_void,
20810 wDesc: cudnnFilterDescriptor_t,
20811 w: *const ::libc::c_void,
20812 dyDesc: cudnnTensorDescriptor_t,
20813 dy: *const ::libc::c_void,
20814 convDesc: cudnnConvolutionDescriptor_t,
20815 algo: cudnnConvolutionBwdDataAlgo_t,
20816 workSpace: *mut ::libc::c_void,
20817 workSpaceSizeInBytes: usize,
20818 beta: *const ::libc::c_void,
20819 dxDesc: cudnnTensorDescriptor_t,
20820 dx: *mut ::libc::c_void,
20821 ) -> cudnnStatus_t;
20822}
20823extern "C" {
20824 pub fn cudnnGetFoldedConvBackwardDataDescriptors(
20825 handle: cudnnHandle_t,
20826 filterDesc: cudnnFilterDescriptor_t,
20827 diffDesc: cudnnTensorDescriptor_t,
20828 convDesc: cudnnConvolutionDescriptor_t,
20829 gradDesc: cudnnTensorDescriptor_t,
20830 transformFormat: cudnnTensorFormat_t,
20831 foldedFilterDesc: cudnnFilterDescriptor_t,
20832 paddedDiffDesc: cudnnTensorDescriptor_t,
20833 foldedConvDesc: cudnnConvolutionDescriptor_t,
20834 foldedGradDesc: cudnnTensorDescriptor_t,
20835 filterFoldTransDesc: cudnnTensorTransformDescriptor_t,
20836 diffPadTransDesc: cudnnTensorTransformDescriptor_t,
20837 gradFoldTransDesc: cudnnTensorTransformDescriptor_t,
20838 gradUnfoldTransDesc: cudnnTensorTransformDescriptor_t,
20839 ) -> cudnnStatus_t;
20840}
20841#[repr(C)]
20842#[derive(Debug, Copy, Clone)]
20843pub struct cudnnFusedOpsConstParamStruct {
20844 _unused: [u8; 0],
20845}
20846pub type cudnnFusedOpsConstParamPack_t = *mut cudnnFusedOpsConstParamStruct;
20847#[repr(C)]
20848#[derive(Debug, Copy, Clone)]
20849pub struct cudnnFusedOpsVariantParamStruct {
20850 _unused: [u8; 0],
20851}
20852pub type cudnnFusedOpsVariantParamPack_t = *mut cudnnFusedOpsVariantParamStruct;
20853#[repr(C)]
20854#[derive(Debug, Copy, Clone)]
20855pub struct cudnnFusedOpsPlanStruct {
20856 _unused: [u8; 0],
20857}
20858pub type cudnnFusedOpsPlan_t = *mut cudnnFusedOpsPlanStruct;
20859#[repr(u32)]
20860#[non_exhaustive]
20861#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20862pub enum cudnnFusedOps_t {
20863 CUDNN_FUSED_SCALE_BIAS_ACTIVATION_CONV_BNSTATS = 0,
20864 CUDNN_FUSED_SCALE_BIAS_ACTIVATION_WGRAD = 1,
20865 CUDNN_FUSED_BN_FINALIZE_STATISTICS_TRAINING = 2,
20866 CUDNN_FUSED_BN_FINALIZE_STATISTICS_INFERENCE = 3,
20867 CUDNN_FUSED_CONV_SCALE_BIAS_ADD_ACTIVATION = 4,
20868 CUDNN_FUSED_SCALE_BIAS_ADD_ACTIVATION_GEN_BITMASK = 5,
20869 CUDNN_FUSED_DACTIVATION_FORK_DBATCHNORM = 6,
20870}
20871#[repr(u32)]
20872#[non_exhaustive]
20873#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20874pub enum cudnnFusedOpsConstParamLabel_t {
20875 CUDNN_PARAM_XDESC = 0,
20876 CUDNN_PARAM_XDATA_PLACEHOLDER = 1,
20877 CUDNN_PARAM_BN_MODE = 2,
20878 CUDNN_PARAM_BN_EQSCALEBIAS_DESC = 3,
20879 CUDNN_PARAM_BN_EQSCALE_PLACEHOLDER = 4,
20880 CUDNN_PARAM_BN_EQBIAS_PLACEHOLDER = 5,
20881 CUDNN_PARAM_ACTIVATION_DESC = 6,
20882 CUDNN_PARAM_CONV_DESC = 7,
20883 CUDNN_PARAM_WDESC = 8,
20884 CUDNN_PARAM_WDATA_PLACEHOLDER = 9,
20885 CUDNN_PARAM_DWDESC = 10,
20886 CUDNN_PARAM_DWDATA_PLACEHOLDER = 11,
20887 CUDNN_PARAM_YDESC = 12,
20888 CUDNN_PARAM_YDATA_PLACEHOLDER = 13,
20889 CUDNN_PARAM_DYDESC = 14,
20890 CUDNN_PARAM_DYDATA_PLACEHOLDER = 15,
20891 CUDNN_PARAM_YSTATS_DESC = 16,
20892 CUDNN_PARAM_YSUM_PLACEHOLDER = 17,
20893 CUDNN_PARAM_YSQSUM_PLACEHOLDER = 18,
20894 CUDNN_PARAM_BN_SCALEBIAS_MEANVAR_DESC = 19,
20895 CUDNN_PARAM_BN_SCALE_PLACEHOLDER = 20,
20896 CUDNN_PARAM_BN_BIAS_PLACEHOLDER = 21,
20897 CUDNN_PARAM_BN_SAVED_MEAN_PLACEHOLDER = 22,
20898 CUDNN_PARAM_BN_SAVED_INVSTD_PLACEHOLDER = 23,
20899 CUDNN_PARAM_BN_RUNNING_MEAN_PLACEHOLDER = 24,
20900 CUDNN_PARAM_BN_RUNNING_VAR_PLACEHOLDER = 25,
20901 CUDNN_PARAM_ZDESC = 26,
20902 CUDNN_PARAM_ZDATA_PLACEHOLDER = 27,
20903 CUDNN_PARAM_BN_Z_EQSCALEBIAS_DESC = 28,
20904 CUDNN_PARAM_BN_Z_EQSCALE_PLACEHOLDER = 29,
20905 CUDNN_PARAM_BN_Z_EQBIAS_PLACEHOLDER = 30,
20906 CUDNN_PARAM_ACTIVATION_BITMASK_DESC = 31,
20907 CUDNN_PARAM_ACTIVATION_BITMASK_PLACEHOLDER = 32,
20908 CUDNN_PARAM_DXDESC = 33,
20909 CUDNN_PARAM_DXDATA_PLACEHOLDER = 34,
20910 CUDNN_PARAM_DZDESC = 35,
20911 CUDNN_PARAM_DZDATA_PLACEHOLDER = 36,
20912 CUDNN_PARAM_BN_DSCALE_PLACEHOLDER = 37,
20913 CUDNN_PARAM_BN_DBIAS_PLACEHOLDER = 38,
20914}
20915#[repr(u32)]
20916#[non_exhaustive]
20917#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20918pub enum cudnnFusedOpsPointerPlaceHolder_t {
20919 CUDNN_PTR_NULL = 0,
20920 CUDNN_PTR_ELEM_ALIGNED = 1,
20921 CUDNN_PTR_16B_ALIGNED = 2,
20922}
20923#[repr(u32)]
20924#[non_exhaustive]
20925#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
20926pub enum cudnnFusedOpsVariantParamLabel_t {
20927 CUDNN_PTR_XDATA = 0,
20928 CUDNN_PTR_BN_EQSCALE = 1,
20929 CUDNN_PTR_BN_EQBIAS = 2,
20930 CUDNN_PTR_WDATA = 3,
20931 CUDNN_PTR_DWDATA = 4,
20932 CUDNN_PTR_YDATA = 5,
20933 CUDNN_PTR_DYDATA = 6,
20934 CUDNN_PTR_YSUM = 7,
20935 CUDNN_PTR_YSQSUM = 8,
20936 CUDNN_PTR_WORKSPACE = 9,
20937 CUDNN_PTR_BN_SCALE = 10,
20938 CUDNN_PTR_BN_BIAS = 11,
20939 CUDNN_PTR_BN_SAVED_MEAN = 12,
20940 CUDNN_PTR_BN_SAVED_INVSTD = 13,
20941 CUDNN_PTR_BN_RUNNING_MEAN = 14,
20942 CUDNN_PTR_BN_RUNNING_VAR = 15,
20943 CUDNN_PTR_ZDATA = 16,
20944 CUDNN_PTR_BN_Z_EQSCALE = 17,
20945 CUDNN_PTR_BN_Z_EQBIAS = 18,
20946 CUDNN_PTR_ACTIVATION_BITMASK = 19,
20947 CUDNN_PTR_DXDATA = 20,
20948 CUDNN_PTR_DZDATA = 21,
20949 CUDNN_PTR_BN_DSCALE = 22,
20950 CUDNN_PTR_BN_DBIAS = 23,
20951 CUDNN_SCALAR_SIZE_T_WORKSPACE_SIZE_IN_BYTES = 100,
20952 CUDNN_SCALAR_INT64_T_BN_ACCUMULATION_COUNT = 101,
20953 CUDNN_SCALAR_DOUBLE_BN_EXP_AVG_FACTOR = 102,
20954 CUDNN_SCALAR_DOUBLE_BN_EPSILON = 103,
20955}
20956extern "C" {
20957 pub fn cudnnCnnInferVersionCheck() -> cudnnStatus_t;
20958}
20959#[repr(C)]
20960#[derive(Debug, Copy, Clone)]
20961pub struct cudnnConvolutionBwdFilterAlgoPerfStruct {
20962 pub algo: cudnnConvolutionBwdFilterAlgo_t,
20963 pub status: cudnnStatus_t,
20964 pub time: f32,
20965 pub memory: usize,
20966 pub determinism: cudnnDeterminism_t,
20967 pub mathType: cudnnMathType_t,
20968 pub reserved: [::libc::c_int; 3usize],
20969}
20970#[test]
20971fn bindgen_test_layout_cudnnConvolutionBwdFilterAlgoPerfStruct() {
20972 assert_eq!(
20973 ::std::mem::size_of::<cudnnConvolutionBwdFilterAlgoPerfStruct>(),
20974 48usize,
20975 concat!(
20976 "Size of: ",
20977 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct)
20978 )
20979 );
20980 assert_eq!(
20981 ::std::mem::align_of::<cudnnConvolutionBwdFilterAlgoPerfStruct>(),
20982 8usize,
20983 concat!(
20984 "Alignment of ",
20985 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct)
20986 )
20987 );
20988 assert_eq!(
20989 unsafe {
20990 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).algo as *const _
20991 as usize
20992 },
20993 0usize,
20994 concat!(
20995 "Offset of field: ",
20996 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
20997 "::",
20998 stringify!(algo)
20999 )
21000 );
21001 assert_eq!(
21002 unsafe {
21003 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).status as *const _
21004 as usize
21005 },
21006 4usize,
21007 concat!(
21008 "Offset of field: ",
21009 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21010 "::",
21011 stringify!(status)
21012 )
21013 );
21014 assert_eq!(
21015 unsafe {
21016 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).time as *const _
21017 as usize
21018 },
21019 8usize,
21020 concat!(
21021 "Offset of field: ",
21022 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21023 "::",
21024 stringify!(time)
21025 )
21026 );
21027 assert_eq!(
21028 unsafe {
21029 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).memory as *const _
21030 as usize
21031 },
21032 16usize,
21033 concat!(
21034 "Offset of field: ",
21035 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21036 "::",
21037 stringify!(memory)
21038 )
21039 );
21040 assert_eq!(
21041 unsafe {
21042 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).determinism
21043 as *const _ as usize
21044 },
21045 24usize,
21046 concat!(
21047 "Offset of field: ",
21048 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21049 "::",
21050 stringify!(determinism)
21051 )
21052 );
21053 assert_eq!(
21054 unsafe {
21055 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).mathType as *const _
21056 as usize
21057 },
21058 28usize,
21059 concat!(
21060 "Offset of field: ",
21061 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21062 "::",
21063 stringify!(mathType)
21064 )
21065 );
21066 assert_eq!(
21067 unsafe {
21068 &(*(::std::ptr::null::<cudnnConvolutionBwdFilterAlgoPerfStruct>())).reserved as *const _
21069 as usize
21070 },
21071 32usize,
21072 concat!(
21073 "Offset of field: ",
21074 stringify!(cudnnConvolutionBwdFilterAlgoPerfStruct),
21075 "::",
21076 stringify!(reserved)
21077 )
21078 );
21079}
21080pub type cudnnConvolutionBwdFilterAlgoPerf_t = cudnnConvolutionBwdFilterAlgoPerfStruct;
21081extern "C" {
21082 pub fn cudnnGetConvolutionBackwardFilterAlgorithmMaxCount(
21083 handle: cudnnHandle_t,
21084 count: *mut ::libc::c_int,
21085 ) -> cudnnStatus_t;
21086}
21087extern "C" {
21088 pub fn cudnnFindConvolutionBackwardFilterAlgorithm(
21089 handle: cudnnHandle_t,
21090 xDesc: cudnnTensorDescriptor_t,
21091 dyDesc: cudnnTensorDescriptor_t,
21092 convDesc: cudnnConvolutionDescriptor_t,
21093 dwDesc: cudnnFilterDescriptor_t,
21094 requestedAlgoCount: ::libc::c_int,
21095 returnedAlgoCount: *mut ::libc::c_int,
21096 perfResults: *mut cudnnConvolutionBwdFilterAlgoPerf_t,
21097 ) -> cudnnStatus_t;
21098}
21099extern "C" {
21100 pub fn cudnnFindConvolutionBackwardFilterAlgorithmEx(
21101 handle: cudnnHandle_t,
21102 xDesc: cudnnTensorDescriptor_t,
21103 x: *const ::libc::c_void,
21104 dyDesc: cudnnTensorDescriptor_t,
21105 y: *const ::libc::c_void,
21106 convDesc: cudnnConvolutionDescriptor_t,
21107 dwDesc: cudnnFilterDescriptor_t,
21108 dw: *mut ::libc::c_void,
21109 requestedAlgoCount: ::libc::c_int,
21110 returnedAlgoCount: *mut ::libc::c_int,
21111 perfResults: *mut cudnnConvolutionBwdFilterAlgoPerf_t,
21112 workSpace: *mut ::libc::c_void,
21113 workSpaceSizeInBytes: usize,
21114 ) -> cudnnStatus_t;
21115}
21116extern "C" {
21117 pub fn cudnnGetConvolutionBackwardFilterAlgorithm_v7(
21118 handle: cudnnHandle_t,
21119 srcDesc: cudnnTensorDescriptor_t,
21120 diffDesc: cudnnTensorDescriptor_t,
21121 convDesc: cudnnConvolutionDescriptor_t,
21122 gradDesc: cudnnFilterDescriptor_t,
21123 requestedAlgoCount: ::libc::c_int,
21124 returnedAlgoCount: *mut ::libc::c_int,
21125 perfResults: *mut cudnnConvolutionBwdFilterAlgoPerf_t,
21126 ) -> cudnnStatus_t;
21127}
21128extern "C" {
21129 pub fn cudnnGetConvolutionBackwardFilterWorkspaceSize(
21130 handle: cudnnHandle_t,
21131 xDesc: cudnnTensorDescriptor_t,
21132 dyDesc: cudnnTensorDescriptor_t,
21133 convDesc: cudnnConvolutionDescriptor_t,
21134 gradDesc: cudnnFilterDescriptor_t,
21135 algo: cudnnConvolutionBwdFilterAlgo_t,
21136 sizeInBytes: *mut usize,
21137 ) -> cudnnStatus_t;
21138}
21139extern "C" {
21140 pub fn cudnnConvolutionBackwardFilter(
21141 handle: cudnnHandle_t,
21142 alpha: *const ::libc::c_void,
21143 xDesc: cudnnTensorDescriptor_t,
21144 x: *const ::libc::c_void,
21145 dyDesc: cudnnTensorDescriptor_t,
21146 dy: *const ::libc::c_void,
21147 convDesc: cudnnConvolutionDescriptor_t,
21148 algo: cudnnConvolutionBwdFilterAlgo_t,
21149 workSpace: *mut ::libc::c_void,
21150 workSpaceSizeInBytes: usize,
21151 beta: *const ::libc::c_void,
21152 dwDesc: cudnnFilterDescriptor_t,
21153 dw: *mut ::libc::c_void,
21154 ) -> cudnnStatus_t;
21155}
21156extern "C" {
21157 pub fn cudnnConvolutionBackwardBias(
21158 handle: cudnnHandle_t,
21159 alpha: *const ::libc::c_void,
21160 dyDesc: cudnnTensorDescriptor_t,
21161 dy: *const ::libc::c_void,
21162 beta: *const ::libc::c_void,
21163 dbDesc: cudnnTensorDescriptor_t,
21164 db: *mut ::libc::c_void,
21165 ) -> cudnnStatus_t;
21166}
21167extern "C" {
21168 pub fn cudnnCreateFusedOpsConstParamPack(
21169 constPack: *mut cudnnFusedOpsConstParamPack_t,
21170 ops: cudnnFusedOps_t,
21171 ) -> cudnnStatus_t;
21172}
21173extern "C" {
21174 pub fn cudnnDestroyFusedOpsConstParamPack(
21175 constPack: cudnnFusedOpsConstParamPack_t,
21176 ) -> cudnnStatus_t;
21177}
21178extern "C" {
21179 pub fn cudnnSetFusedOpsConstParamPackAttribute(
21180 constPack: cudnnFusedOpsConstParamPack_t,
21181 paramLabel: cudnnFusedOpsConstParamLabel_t,
21182 param: *const ::libc::c_void,
21183 ) -> cudnnStatus_t;
21184}
21185extern "C" {
21186 pub fn cudnnGetFusedOpsConstParamPackAttribute(
21187 constPack: cudnnFusedOpsConstParamPack_t,
21188 paramLabel: cudnnFusedOpsConstParamLabel_t,
21189 param: *mut ::libc::c_void,
21190 isNULL: *mut ::libc::c_int,
21191 ) -> cudnnStatus_t;
21192}
21193extern "C" {
21194 pub fn cudnnCreateFusedOpsVariantParamPack(
21195 varPack: *mut cudnnFusedOpsVariantParamPack_t,
21196 ops: cudnnFusedOps_t,
21197 ) -> cudnnStatus_t;
21198}
21199extern "C" {
21200 pub fn cudnnDestroyFusedOpsVariantParamPack(
21201 varPack: cudnnFusedOpsVariantParamPack_t,
21202 ) -> cudnnStatus_t;
21203}
21204extern "C" {
21205 pub fn cudnnSetFusedOpsVariantParamPackAttribute(
21206 varPack: cudnnFusedOpsVariantParamPack_t,
21207 paramLabel: cudnnFusedOpsVariantParamLabel_t,
21208 ptr: *mut ::libc::c_void,
21209 ) -> cudnnStatus_t;
21210}
21211extern "C" {
21212 pub fn cudnnGetFusedOpsVariantParamPackAttribute(
21213 varPack: cudnnFusedOpsVariantParamPack_t,
21214 paramLabel: cudnnFusedOpsVariantParamLabel_t,
21215 ptr: *mut ::libc::c_void,
21216 ) -> cudnnStatus_t;
21217}
21218extern "C" {
21219 pub fn cudnnCreateFusedOpsPlan(
21220 plan: *mut cudnnFusedOpsPlan_t,
21221 ops: cudnnFusedOps_t,
21222 ) -> cudnnStatus_t;
21223}
21224extern "C" {
21225 pub fn cudnnDestroyFusedOpsPlan(plan: cudnnFusedOpsPlan_t) -> cudnnStatus_t;
21226}
21227extern "C" {
21228 pub fn cudnnMakeFusedOpsPlan(
21229 handle: cudnnHandle_t,
21230 plan: cudnnFusedOpsPlan_t,
21231 constPack: cudnnFusedOpsConstParamPack_t,
21232 workspaceSizeInBytes: *mut usize,
21233 ) -> cudnnStatus_t;
21234}
21235extern "C" {
21236 pub fn cudnnFusedOpsExecute(
21237 handle: cudnnHandle_t,
21238 plan: cudnnFusedOpsPlan_t,
21239 varPack: cudnnFusedOpsVariantParamPack_t,
21240 ) -> cudnnStatus_t;
21241}
21242extern "C" {
21243 pub fn cudnnCnnTrainVersionCheck() -> cudnnStatus_t;
21244}
21245pub type cudnnBackendDescriptor_t = *mut ::libc::c_void;
21246#[repr(u32)]
21247#[non_exhaustive]
21248#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21249pub enum cudnnPointwiseMode_t {
21250 CUDNN_POINTWISE_ADD = 0,
21251 CUDNN_POINTWISE_MUL = 1,
21252 CUDNN_POINTWISE_MIN = 2,
21253 CUDNN_POINTWISE_MAX = 3,
21254 CUDNN_POINTWISE_SQRT = 4,
21255 CUDNN_POINTWISE_RELU_FWD = 100,
21256 CUDNN_POINTWISE_TANH_FWD = 101,
21257 CUDNN_POINTWISE_SIGMOID_FWD = 102,
21258 CUDNN_POINTWISE_ELU_FWD = 103,
21259 CUDNN_POINTWISE_GELU_FWD = 104,
21260 CUDNN_POINTWISE_SOFTPLUS_FWD = 105,
21261 CUDNN_POINTWISE_SWISH_FWD = 106,
21262 CUDNN_POINTWISE_RELU_BWD = 200,
21263 CUDNN_POINTWISE_TANH_BWD = 201,
21264 CUDNN_POINTWISE_SIGMOID_BWD = 202,
21265 CUDNN_POINTWISE_ELU_BWD = 203,
21266 CUDNN_POINTWISE_GELU_BWD = 204,
21267 CUDNN_POINTWISE_SOFTPLUS_BWD = 205,
21268 CUDNN_POINTWISE_SWISH_BWD = 206,
21269}
21270#[repr(u32)]
21271#[non_exhaustive]
21272#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21273pub enum cudnnGenStatsMode_t {
21274 CUDNN_GENSTATS_SUM_SQSUM = 0,
21275}
21276#[repr(u32)]
21277#[non_exhaustive]
21278#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21279pub enum cudnnBnFinalizeStatsMode_t {
21280 CUDNN_BN_FINALIZE_STATISTICS_TRAINING = 0,
21281 CUDNN_BN_FINALIZE_STATISTICS_INFERENCE = 1,
21282}
21283#[repr(u32)]
21284#[non_exhaustive]
21285#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21286pub enum cudnnBackendAttributeName_t {
21287 CUDNN_ATTR_POINTWISE_MODE = 0,
21288 CUDNN_ATTR_POINTWISE_MATH_PREC = 1,
21289 CUDNN_ATTR_POINTWISE_NAN_PROPAGATION = 2,
21290 CUDNN_ATTR_POINTWISE_RELU_LOWER_CLIP = 3,
21291 CUDNN_ATTR_POINTWISE_RELU_UPPER_CLIP = 4,
21292 CUDNN_ATTR_POINTWISE_RELU_LOWER_CLIP_SLOPE = 5,
21293 CUDNN_ATTR_POINTWISE_ELU_ALPHA = 6,
21294 CUDNN_ATTR_POINTWISE_SOFTPLUS_BETA = 7,
21295 CUDNN_ATTR_POINTWISE_SWISH_BETA = 8,
21296 CUDNN_ATTR_CONVOLUTION_COMP_TYPE = 100,
21297 CUDNN_ATTR_CONVOLUTION_CONV_MODE = 101,
21298 CUDNN_ATTR_CONVOLUTION_DILATIONS = 102,
21299 CUDNN_ATTR_CONVOLUTION_FILTER_STRIDES = 103,
21300 CUDNN_ATTR_CONVOLUTION_POST_PADDINGS = 104,
21301 CUDNN_ATTR_CONVOLUTION_PRE_PADDINGS = 105,
21302 CUDNN_ATTR_CONVOLUTION_SPATIAL_DIMS = 106,
21303 CUDNN_ATTR_ENGINEHEUR_MODE = 200,
21304 CUDNN_ATTR_ENGINEHEUR_OPERATION_GRAPH = 201,
21305 CUDNN_ATTR_ENGINEHEUR_RESULTS = 202,
21306 CUDNN_ATTR_ENGINECFG_ENGINE = 300,
21307 CUDNN_ATTR_ENGINECFG_INTERMEDIATE_INFO = 301,
21308 CUDNN_ATTR_ENGINECFG_KNOB_CHOICES = 302,
21309 CUDNN_ATTR_EXECUTION_PLAN_HANDLE = 400,
21310 CUDNN_ATTR_EXECUTION_PLAN_ENGINE_CONFIG = 401,
21311 CUDNN_ATTR_EXECUTION_PLAN_WORKSPACE_SIZE = 402,
21312 CUDNN_ATTR_EXECUTION_PLAN_COMPUTED_INTERMEDIATE_UIDS = 403,
21313 CUDNN_ATTR_EXECUTION_PLAN_RUN_ONLY_INTERMEDIATE_UIDS = 404,
21314 CUDNN_ATTR_INTERMEDIATE_INFO_UNIQUE_ID = 500,
21315 CUDNN_ATTR_INTERMEDIATE_INFO_SIZE = 501,
21316 CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_DATA_UIDS = 502,
21317 CUDNN_ATTR_INTERMEDIATE_INFO_DEPENDENT_ATTRIBUTES = 503,
21318 CUDNN_ATTR_KNOB_CHOICE_KNOB_TYPE = 600,
21319 CUDNN_ATTR_KNOB_CHOICE_KNOB_VALUE = 601,
21320 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_ALPHA = 700,
21321 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_BETA = 701,
21322 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_CONV_DESC = 702,
21323 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_W = 703,
21324 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_X = 704,
21325 CUDNN_ATTR_OPERATION_CONVOLUTION_FORWARD_Y = 705,
21326 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_ALPHA = 706,
21327 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_BETA = 707,
21328 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_CONV_DESC = 708,
21329 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_W = 709,
21330 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DX = 710,
21331 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_DATA_DY = 711,
21332 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_ALPHA = 712,
21333 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_BETA = 713,
21334 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_CONV_DESC = 714,
21335 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DW = 715,
21336 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_X = 716,
21337 CUDNN_ATTR_OPERATION_CONVOLUTION_BWD_FILTER_DY = 717,
21338 CUDNN_ATTR_OPERATION_POINTWISE_PW_DESCRIPTOR = 750,
21339 CUDNN_ATTR_OPERATION_POINTWISE_XDESC = 751,
21340 CUDNN_ATTR_OPERATION_POINTWISE_BDESC = 752,
21341 CUDNN_ATTR_OPERATION_POINTWISE_YDESC = 753,
21342 CUDNN_ATTR_OPERATION_POINTWISE_ALPHA1 = 754,
21343 CUDNN_ATTR_OPERATION_POINTWISE_ALPHA2 = 755,
21344 CUDNN_ATTR_OPERATION_POINTWISE_DXDESC = 756,
21345 CUDNN_ATTR_OPERATION_POINTWISE_DYDESC = 757,
21346 CUDNN_ATTR_OPERATION_GENSTATS_MODE = 770,
21347 CUDNN_ATTR_OPERATION_GENSTATS_MATH_PREC = 771,
21348 CUDNN_ATTR_OPERATION_GENSTATS_XDESC = 772,
21349 CUDNN_ATTR_OPERATION_GENSTATS_SUMDESC = 773,
21350 CUDNN_ATTR_OPERATION_GENSTATS_SQSUMDESC = 774,
21351 CUDNN_ATTR_OPERATION_BN_FINALIZE_STATS_MODE = 780,
21352 CUDNN_ATTR_OPERATION_BN_FINALIZE_MATH_PREC = 781,
21353 CUDNN_ATTR_OPERATION_BN_FINALIZE_Y_SUM_DESC = 782,
21354 CUDNN_ATTR_OPERATION_BN_FINALIZE_Y_SQ_SUM_DESC = 783,
21355 CUDNN_ATTR_OPERATION_BN_FINALIZE_SCALE_DESC = 784,
21356 CUDNN_ATTR_OPERATION_BN_FINALIZE_BIAS_DESC = 785,
21357 CUDNN_ATTR_OPERATION_BN_FINALIZE_PREV_RUNNING_MEAN_DESC = 786,
21358 CUDNN_ATTR_OPERATION_BN_FINALIZE_PREV_RUNNING_VAR_DESC = 787,
21359 CUDNN_ATTR_OPERATION_BN_FINALIZE_UPDATED_RUNNING_MEAN_DESC = 788,
21360 CUDNN_ATTR_OPERATION_BN_FINALIZE_UPDATED_RUNNING_VAR_DESC = 789,
21361 CUDNN_ATTR_OPERATION_BN_FINALIZE_SAVED_MEAN_DESC = 790,
21362 CUDNN_ATTR_OPERATION_BN_FINALIZE_SAVED_INV_STD_DESC = 791,
21363 CUDNN_ATTR_OPERATION_BN_FINALIZE_EQ_SCALE_DESC = 792,
21364 CUDNN_ATTR_OPERATION_BN_FINALIZE_EQ_BIAS_DESC = 793,
21365 CUDNN_ATTR_OPERATION_BN_FINALIZE_ACCUM_COUNT_DESC = 794,
21366 CUDNN_ATTR_OPERATION_BN_FINALIZE_EPSILON_DESC = 795,
21367 CUDNN_ATTR_OPERATION_BN_FINALIZE_EXP_AVERATE_FACTOR_DESC = 796,
21368 CUDNN_ATTR_OPERATIONGRAPH_HANDLE = 800,
21369 CUDNN_ATTR_OPERATIONGRAPH_OPS = 801,
21370 CUDNN_ATTR_OPERATIONGRAPH_ENGINE_GLOBAL_COUNT = 802,
21371 CUDNN_ATTR_TENSOR_BYTE_ALIGNMENT = 900,
21372 CUDNN_ATTR_TENSOR_DATA_TYPE = 901,
21373 CUDNN_ATTR_TENSOR_DIMENSIONS = 902,
21374 CUDNN_ATTR_TENSOR_STRIDES = 903,
21375 CUDNN_ATTR_TENSOR_VECTOR_COUNT = 904,
21376 CUDNN_ATTR_TENSOR_VECTORIZED_DIMENSION = 905,
21377 CUDNN_ATTR_TENSOR_UNIQUE_ID = 906,
21378 CUDNN_ATTR_TENSOR_IS_VIRTUAL = 907,
21379 CUDNN_ATTR_TENSOR_IS_BY_VALUE = 908,
21380 CUDNN_ATTR_VARIANT_PACK_UNIQUE_IDS = 1000,
21381 CUDNN_ATTR_VARIANT_PACK_DATA_POINTERS = 1001,
21382 CUDNN_ATTR_VARIANT_PACK_INTERMEDIATES = 1002,
21383 CUDNN_ATTR_VARIANT_PACK_WORKSPACE = 1003,
21384 CUDNN_ATTR_LAYOUT_INFO_TENSOR_UID = 1100,
21385 CUDNN_ATTR_LAYOUT_INFO_TYPES = 1101,
21386 CUDNN_ATTR_KNOB_INFO_TYPE = 1200,
21387 CUDNN_ATTR_KNOB_INFO_MAXIMUM_VALUE = 1201,
21388 CUDNN_ATTR_KNOB_INFO_MINIMUM_VALUE = 1202,
21389 CUDNN_ATTR_KNOB_INFO_STRIDE = 1203,
21390 CUDNN_ATTR_ENGINE_OPERATION_GRAPH = 1300,
21391 CUDNN_ATTR_ENGINE_GLOBAL_INDEX = 1301,
21392 CUDNN_ATTR_ENGINE_KNOB_INFO = 1302,
21393 CUDNN_ATTR_ENGINE_NUMERICAL_NOTE = 1303,
21394 CUDNN_ATTR_ENGINE_LAYOUT_INFO = 1304,
21395 CUDNN_ATTR_ENGINE_BEHAVIOR_NOTE = 1305,
21396 CUDNN_ATTR_MATMUL_COMP_TYPE = 1500,
21397 CUDNN_ATTR_OPERATION_MATMUL_ADESC = 1520,
21398 CUDNN_ATTR_OPERATION_MATMUL_BDESC = 1521,
21399 CUDNN_ATTR_OPERATION_MATMUL_CDESC = 1522,
21400 CUDNN_ATTR_OPERATION_MATMUL_DESC = 1523,
21401 CUDNN_ATTR_OPERATION_MATMUL_IRREGULARLY_STRIDED_BATCH_COUNT = 1524,
21402 CUDNN_ATTR_REDUCTION_OPERATOR = 1600,
21403 CUDNN_ATTR_REDUCTION_COMP_TYPE = 1601,
21404 CUDNN_ATTR_OPERATION_REDUCTION_XDESC = 1610,
21405 CUDNN_ATTR_OPERATION_REDUCTION_YDESC = 1611,
21406 CUDNN_ATTR_OPERATION_REDUCTION_DESC = 1612,
21407 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_MATH_PREC = 1620,
21408 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_MEAN_DESC = 1621,
21409 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_INVSTD_DESC = 1622,
21410 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_BN_SCALE_DESC = 1623,
21411 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_X_DESC = 1624,
21412 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DY_DESC = 1625,
21413 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DBN_SCALE_DESC = 1626,
21414 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_DBN_BIAS_DESC = 1627,
21415 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_DY_SCALE_DESC = 1628,
21416 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_X_SCALE_DESC = 1629,
21417 CUDNN_ATTR_OPERATION_BN_BWD_WEIGHTS_EQ_BIAS = 1630,
21418}
21419#[repr(u32)]
21420#[non_exhaustive]
21421#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21422pub enum cudnnBackendAttributeType_t {
21423 CUDNN_TYPE_HANDLE = 0,
21424 CUDNN_TYPE_DATA_TYPE = 1,
21425 CUDNN_TYPE_BOOLEAN = 2,
21426 CUDNN_TYPE_INT64 = 3,
21427 CUDNN_TYPE_FLOAT = 4,
21428 CUDNN_TYPE_DOUBLE = 5,
21429 CUDNN_TYPE_VOID_PTR = 6,
21430 CUDNN_TYPE_CONVOLUTION_MODE = 7,
21431 CUDNN_TYPE_HEUR_MODE = 8,
21432 CUDNN_TYPE_KNOB_TYPE = 9,
21433 CUDNN_TYPE_NAN_PROPOGATION = 10,
21434 CUDNN_TYPE_NUMERICAL_NOTE = 11,
21435 CUDNN_TYPE_LAYOUT_TYPE = 12,
21436 CUDNN_TYPE_ATTRIB_NAME = 13,
21437 CUDNN_TYPE_POINTWISE_MODE = 14,
21438 CUDNN_TYPE_BACKEND_DESCRIPTOR = 15,
21439 CUDNN_TYPE_GENSTATS_MODE = 16,
21440 CUDNN_TYPE_BN_FINALIZE_STATS_MODE = 17,
21441 CUDNN_TYPE_REDUCTION_OPERATOR_TYPE = 18,
21442 CUDNN_TYPE_BEHAVIOR_NOTE = 19,
21443}
21444#[repr(u32)]
21445#[non_exhaustive]
21446#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21447pub enum cudnnBackendDescriptorType_t {
21448 CUDNN_BACKEND_POINTWISE_DESCRIPTOR = 0,
21449 CUDNN_BACKEND_CONVOLUTION_DESCRIPTOR = 1,
21450 CUDNN_BACKEND_ENGINE_DESCRIPTOR = 2,
21451 CUDNN_BACKEND_ENGINECFG_DESCRIPTOR = 3,
21452 CUDNN_BACKEND_ENGINEHEUR_DESCRIPTOR = 4,
21453 CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR = 5,
21454 CUDNN_BACKEND_INTERMEDIATE_INFO_DESCRIPTOR = 6,
21455 CUDNN_BACKEND_KNOB_CHOICE_DESCRIPTOR = 7,
21456 CUDNN_BACKEND_KNOB_INFO_DESCRIPTOR = 8,
21457 CUDNN_BACKEND_LAYOUT_INFO_DESCRIPTOR = 9,
21458 CUDNN_BACKEND_OPERATION_CONVOLUTION_FORWARD_DESCRIPTOR = 10,
21459 CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_FILTER_DESCRIPTOR = 11,
21460 CUDNN_BACKEND_OPERATION_CONVOLUTION_BACKWARD_DATA_DESCRIPTOR = 12,
21461 CUDNN_BACKEND_OPERATION_POINTWISE_DESCRIPTOR = 13,
21462 CUDNN_BACKEND_OPERATION_GEN_STATS_DESCRIPTOR = 14,
21463 CUDNN_BACKEND_OPERATIONGRAPH_DESCRIPTOR = 15,
21464 CUDNN_BACKEND_VARIANT_PACK_DESCRIPTOR = 16,
21465 CUDNN_BACKEND_TENSOR_DESCRIPTOR = 17,
21466 CUDNN_BACKEND_MATMUL_DESCRIPTOR = 18,
21467 CUDNN_BACKEND_OPERATION_MATMUL_DESCRIPTOR = 19,
21468 CUDNN_BACKEND_OPERATION_BN_FINALIZE_STATISTICS_DESCRIPTOR = 20,
21469 CUDNN_BACKEND_REDUCTION_DESCRIPTOR = 21,
21470 CUDNN_BACKEND_OPERATION_REDUCTION_DESCRIPTOR = 22,
21471 CUDNN_BACKEND_OPERATION_BN_BWD_WEIGHTS_DESCRIPTOR = 23,
21472}
21473#[repr(u32)]
21474#[non_exhaustive]
21475#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21476pub enum cudnnBackendNumericalNote_t {
21477 CUDNN_NUMERICAL_NOTE_TENSOR_CORE = 0,
21478 CUDNN_NUMERICAL_NOTE_DOWN_CONVERT_INPUTS = 1,
21479 CUDNN_NUMERICAL_NOTE_REDUCED_PRECISION_REDUCTION = 2,
21480 CUDNN_NUMERICAL_NOTE_FFT = 3,
21481 CUDNN_NUMERICAL_NOTE_NONDETERMINISTIC = 4,
21482 CUDNN_NUMERICAL_NOTE_WINOGRAD = 5,
21483 CUDNN_NUMERICAL_NOTE_TYPE_COUNT = 6,
21484}
21485#[repr(u32)]
21486#[non_exhaustive]
21487#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21488pub enum cudnnBackendBehaviorNote_t {
21489 CUDNN_BEHAVIOR_NOTE_RUNTIME_COMPILATION = 0,
21490 CUDNN_BEHAVIOR_NOTE_TYPE_COUNT = 1,
21491}
21492#[repr(u32)]
21493#[non_exhaustive]
21494#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21495pub enum cudnnBackendKnobType_t {
21496 CUDNN_KNOB_TYPE_SPLIT_K = 0,
21497 CUDNN_KNOB_TYPE_SWIZZLE = 1,
21498 CUDNN_KNOB_TYPE_TILE_SIZE = 2,
21499 CUDNN_KNOB_TYPE_USE_TEX = 3,
21500 CUDNN_KNOB_TYPE_EDGE = 4,
21501 CUDNN_KNOB_TYPE_KBLOCK = 5,
21502 CUDNN_KNOB_TYPE_LDGA = 6,
21503 CUDNN_KNOB_TYPE_LDGB = 7,
21504 CUDNN_KNOB_TYPE_CHUNK_K = 8,
21505 CUDNN_KNOB_TYPE_SPLIT_H = 9,
21506 CUDNN_KNOB_TYPE_WINO_TILE = 10,
21507 CUDNN_KNOB_TYPE_MULTIPLY = 11,
21508 CUDNN_KNOB_TYPE_SPLIT_K_BUF = 12,
21509 CUDNN_KNOB_TYPE_TILEK = 13,
21510 CUDNN_KNOB_TYPE_STAGES = 14,
21511 CUDNN_KNOB_TYPE_REDUCTION_MODE = 15,
21512 CUDNN_KNOB_TYPE_CTA_SPLIT_K_MODE = 16,
21513 CUDNN_KNOB_TYPE_SPLIT_K_SLC = 17,
21514 CUDNN_KNOB_TYPE_IDX_MODE = 18,
21515 CUDNN_KNOB_TYPE_SLICED = 19,
21516 CUDNN_KNOB_TYPE_SPLIT_RS = 20,
21517 CUDNN_KNOB_TYPE_SINGLEBUFFER = 21,
21518 CUDNN_KNOB_TYPE_LDGC = 22,
21519 CUDNN_KNOB_TYPE_SPECFILT = 23,
21520 CUDNN_KNOB_TYPE_KERNEL_CFG = 24,
21521 CUDNN_KNOB_TYPE_COUNTS = 25,
21522}
21523#[repr(u32)]
21524#[non_exhaustive]
21525#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21526pub enum cudnnBackendLayoutType_t {
21527 CUDNN_LAYOUT_TYPE_PREFERRED_NCHW = 0,
21528 CUDNN_LAYOUT_TYPE_PREFERRED_NHWC = 1,
21529 CUDNN_LAYOUT_TYPE_PREFERRED_PAD4CK = 2,
21530 CUDNN_LAYOUT_TYPE_PREFERRED_PAD8CK = 3,
21531 CUDNN_LAYOUT_TYPE_COUNT = 4,
21532}
21533#[repr(u32)]
21534#[non_exhaustive]
21535#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
21536pub enum cudnnBackendHeurMode_t {
21537 CUDNN_HEUR_MODE_INSTANT = 0,
21538 CUDNN_HEUR_MODE_B = 1,
21539 CUDNN_HEUR_MODES_COUNT = 2,
21540}
21541extern "C" {
21542 pub fn cudnnBackendCreateDescriptor(
21543 descriptorType: cudnnBackendDescriptorType_t,
21544 descriptor: *mut cudnnBackendDescriptor_t,
21545 ) -> cudnnStatus_t;
21546}
21547extern "C" {
21548 pub fn cudnnBackendDestroyDescriptor(descriptor: cudnnBackendDescriptor_t) -> cudnnStatus_t;
21549}
21550extern "C" {
21551 pub fn cudnnBackendInitialize(descriptor: cudnnBackendDescriptor_t) -> cudnnStatus_t;
21552}
21553extern "C" {
21554 pub fn cudnnBackendFinalize(descriptor: cudnnBackendDescriptor_t) -> cudnnStatus_t;
21555}
21556extern "C" {
21557 pub fn cudnnBackendSetAttribute(
21558 descriptor: cudnnBackendDescriptor_t,
21559 attributeName: cudnnBackendAttributeName_t,
21560 attributeType: cudnnBackendAttributeType_t,
21561 elementCount: i64,
21562 arrayOfElements: *const ::libc::c_void,
21563 ) -> cudnnStatus_t;
21564}
21565extern "C" {
21566 pub fn cudnnBackendGetAttribute(
21567 descriptor: cudnnBackendDescriptor_t,
21568 attributeName: cudnnBackendAttributeName_t,
21569 attributeType: cudnnBackendAttributeType_t,
21570 requestedElementCount: i64,
21571 elementCount: *mut i64,
21572 arrayOfElements: *mut ::libc::c_void,
21573 ) -> cudnnStatus_t;
21574}
21575extern "C" {
21576 pub fn cudnnBackendExecute(
21577 handle: cudnnHandle_t,
21578 executionPlan: cudnnBackendDescriptor_t,
21579 variantPack: cudnnBackendDescriptor_t,
21580 ) -> cudnnStatus_t;
21581}