singe-cufft-sys 0.1.0-alpha.5

Low-level FFI bindings for the NVIDIA cuFFT fast Fourier transform library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
/* automatically generated by rust-bindgen 0.72.1 */

pub const CUFFT_VER_MAJOR: u32 = 12;
pub const CUFFT_VER_MINOR: u32 = 2;
pub const CUFFT_VER_PATCH: u32 = 0;
pub const CUFFT_VER_BUILD: u32 = 37;
pub const CUFFT_VERSION: u32 = 12200;
pub const CUFFT_FORWARD: i32 = -1;
pub const CUFFT_INVERSE: u32 = 1;
pub const CUFFT_PLAN_NULL: i32 = -1;
#[repr(C)]
#[repr(align(8))]
#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
pub struct float2 {
    pub x: f32,
    pub y: f32,
}
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Default, Copy, Clone, PartialOrd, PartialEq)]
pub struct double2 {
    pub x: f64,
    pub y: f64,
}
pub type cuFloatComplex = float2;
pub type cuDoubleComplex = double2;
pub type cuComplex = cuFloatComplex;
pub type size_t = ::core::ffi::c_ulong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
    _unused: [u8; 0],
}
/// All cuFFT Library return values except for [`cufftResult::CUFFT_SUCCESS`] indicate that the current API call failed and the user should reconfigure to correct the problem. The possible return values are defined as follows.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cufftResult_t {
    /// The cuFFT operation was successful.
    CUFFT_SUCCESS = 0,
    /// cuFFT was passed an invalid plan handle.
    CUFFT_INVALID_PLAN = 1,
    /// cuFFT failed to allocate GPU or CPU memory.
    CUFFT_ALLOC_FAILED = 2,
    /// The cuFFT type provided is unsupported.
    CUFFT_INVALID_TYPE = 3,
    /// User specified an invalid pointer or parameter.
    CUFFT_INVALID_VALUE = 4,
    /// Driver or internal cuFFT library error.
    CUFFT_INTERNAL_ERROR = 5,
    /// Failed to execute an FFT on the GPU.
    CUFFT_EXEC_FAILED = 6,
    /// The cuFFT library failed to initialize.
    CUFFT_SETUP_FAILED = 7,
    /// User specified an invalid transform size.
    CUFFT_INVALID_SIZE = 8,
    /// Not currently in use.
    CUFFT_UNALIGNED_DATA = 9,
    /// Execution of a plan was on different GPU than plan creation.
    CUFFT_INVALID_DEVICE = 11,
    /// No workspace has been provided prior to plan execution.
    CUFFT_NO_WORKSPACE = 13,
    /// Function does not implement functionality for parameters given.
    CUFFT_NOT_IMPLEMENTED = 14,
    /// Operation is not supported for parameters given.
    CUFFT_NOT_SUPPORTED = 16,
    /// cuFFT is unable to find a dependency.
    CUFFT_MISSING_DEPENDENCY = 17,
    /// An NVRTC failure was encountered during a cuFFT operation.
    CUFFT_NVRTC_FAILURE = 18,
    /// An nvJitLink failure was encountered during a cuFFT operation.
    CUFFT_NVJITLINK_FAILURE = 19,
    /// An NVSHMEM failure was encountered during a cuFFT operation.
    CUFFT_NVSHMEM_FAILURE = 20,
}
pub use self::cufftResult_t as cufftResult;
/// A single-precision, floating-point real data type.
pub type cufftReal = f32;
/// A double-precision, floating-point real data type.
pub type cufftDoubleReal = f64;
/// A single-precision, floating-point complex data type that consists of interleaved real and imaginary components.
pub type cufftComplex = cuComplex;
/// A double-precision, floating-point complex data type that consists of interleaved real and imaginary components.
pub type cufftDoubleComplex = cuDoubleComplex;
/// The cuFFT library supports complex- and real-data transforms. The `cufftType` data type is an enumeration of the types of transform data supported by cuFFT.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cufftType_t {
    /// Real to complex (interleaved).
    CUFFT_R2C = 42,
    /// Complex (interleaved) to real.
    CUFFT_C2R = 44,
    /// Complex to complex (interleaved).
    CUFFT_C2C = 41,
    /// Double to double-complex (interleaved).
    CUFFT_D2Z = 106,
    /// Double-complex (interleaved) to double.
    CUFFT_Z2D = 108,
    /// Double-complex to double-complex (interleaved).
    CUFFT_Z2Z = 105,
}
pub use self::cufftType_t as cufftType;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cufftCompatibility_t {
    CUFFT_COMPATIBILITY_FFTW_PADDING = 1,
}
pub use self::cufftCompatibility_t as cufftCompatibility;
/// A handle type used to store and access cuFFT plans. The user receives a handle after creating a cuFFT plan and uses this handle to execute the plan.
pub type cufftHandle = ::core::ffi::c_int;
unsafe extern "C" {
    /// Creates a 1D FFT plan configuration for a specified signal size and data type. The `batch` input parameter tells cuFFT how many 1D transforms to configure.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// # Parameters
    ///
    /// - `plan`: Pointer to an uninitialized [`cufftHandle`] object.
    ///
    /// Contains a cuFFT 1D plan handle value.
    /// - `nx`: The transform size (e.g. 256 for a 256-point FFT).
    /// - `batch`: Number of transforms of size `nx`. Please consider using [`cufftPlanMany`] for multiple transforms.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: The `nx` or `batch` parameter is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftPlan1d(
        plan: *mut cufftHandle,
        nx: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Creates a 2D FFT plan configuration according to specified signal sizes and data type.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// # Parameters
    ///
    /// - `plan`: Pointer to an uninitialized [`cufftHandle`] object.
    ///
    /// Contains a cuFFT 2D plan handle value.
    /// - `nx`: The transform size in the *x* dimension This is slowest changing dimension of a transform (strided in memory).
    /// - `ny`: The transform size in the *y* dimension. This is fastest changing dimension of a transform (contiguous in memory).
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: Either or both of the `nx` or `ny` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftPlan2d(
        plan: *mut cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        type_: cufftType,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Creates a 3D FFT plan configuration according to specified signal sizes and data type. This function is the same as [`cufftPlan2d`] except that it takes a third size parameter `nz`.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// # Parameters
    ///
    /// - `plan`: Pointer to an uninitialized [`cufftHandle`] object.
    ///
    /// Contains a cuFFT 3D plan handle value.
    /// - `nx`: The transform size in the *x* dimension. This is slowest changing dimension of a transform (strided in memory).
    /// - `ny`: The transform size in the *y* dimension.
    /// - `nz`: The transform size in the *z* dimension. This is fastest changing dimension of a transform (contiguous in memory).
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the `nx`, `ny`, or `nz` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftPlan3d(
        plan: *mut cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        nz: ::core::ffi::c_int,
        type_: cufftType,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Creates a FFT plan configuration of dimension `rank`, with sizes specified in the array `n`. The `batch` input parameter tells cuFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
    ///
    /// The [`cufftPlanMany`] API supports more complicated input and output data layouts via the advanced data layout parameters: `inembed`, `istride`, `idist`, `onembed`, `ostride`, and `odist`.
    ///
    /// If `inembed` and `onembed` are set to `NULL`, all other stride information is ignored, and default strides are used. The default assumes contiguous data arrays.
    ///
    /// All arrays are assumed to be in CPU memory.
    ///
    /// Please note that behavior of [`cufftPlanMany`] function when `inembed` and `onembed` is `NULL` is different than corresponding function in FFTW library `fftw_plan_many_dft`.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// # Parameters
    ///
    /// - `plan`: Pointer to an uninitialized [`cufftHandle`] object.
    ///
    /// Contains a cuFFT plan handle.
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension, `n\[0\]` being the size of the outermost and `n\[rank-1\]` innermost (contiguous) dimension of a transform.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftPlanMany(
        plan: *mut cufftHandle,
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_int,
        inembed: *mut ::core::ffi::c_int,
        istride: ::core::ffi::c_int,
        idist: ::core::ffi::c_int,
        onembed: *mut ::core::ffi::c_int,
        ostride: ::core::ffi::c_int,
        odist: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Following a call to [`cufftCreate`] makes a 1D FFT plan configuration for a specified signal size and data type. The `batch` input parameter tells cuFFT how many 1D transforms to configure.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// If `cufftXtSetGPUs()` was called prior to this call with multiple GPUs, then `workSize` will contain multiple sizes. See sections on multiple GPUs for more details.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `nx`: The transform size (e.g. 256 for a 256-point FFT). For multiple GPUs, this must be a power of 2.
    /// - `batch`: Number of transforms of size `nx`. Please consider using [`cufftMakePlanMany`] for multiple transforms.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size(s) of the work areas.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked or multi-GPU restrictions are not met.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: The `nx` or `batch` parameter is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult_t::CUFFT_SETUP_FAILED`]`: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftMakePlan1d(
        plan: cufftHandle,
        nx: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Following a call to [`cufftCreate`] makes a 2D FFT plan configuration according to specified signal sizes and data type.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// If `cufftXtSetGPUs()` was called prior to this call with multiple GPUs, then `workSize` will contain multiple sizes. See sections on multiple GPUs for more details.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `nx`: The transform size in the *x* dimension. This is slowest changing dimension of a transform (strided in memory). For multiple GPUs, this must be factorable into primes less than or equal to 127.
    /// - `ny`: The transform size in the *y* dimension. This is fastest changing dimension of a transform (contiguous in memory). For 2 GPUs, this must be factorable into primes less than or equal to 127.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size(s) of the work areas.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: Either or both of the `nx` or `ny` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftMakePlan2d(
        plan: cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Following a call to [`cufftCreate`] makes a 3D FFT plan configuration according to specified signal sizes and data type. This function is the same as [`cufftPlan2d`] except that it takes a third size parameter `nz`.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// If `cufftXtSetGPUs()` was called prior to this call with multiple GPUs, then `workSize` will contain multiple sizes. See sections on multiple GPUs for more details.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `nx`: The transform size in the *x* dimension. This is slowest changing dimension of a transform (strided in memory). For multiple GPUs, this must be factorable into primes less than or equal to 127.
    /// - `ny`: The transform size in the *y* dimension. For multiple GPUs, this must be factorable into primes less than or equal to 127.
    /// - `nz`: The transform size in the *z* dimension. This is fastest changing dimension of a transform (contiguous in memory). For multiple GPUs, this must be factorable into primes less than or equal to 127.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size(s) of the work area(s).
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the `nx`, `ny`, or `nz` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftMakePlan3d(
        plan: cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        nz: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Following a call to [`cufftCreate`] makes a FFT plan configuration of dimension `rank`, with sizes specified in the array `n`. The `batch` input parameter tells cuFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
    ///
    /// The [`cufftPlanMany`] API supports more complicated input and output data layouts via the advanced data layout parameters: `inembed`, `istride`, `idist`, `onembed`, `ostride`, and `odist`.
    ///
    /// If `inembed` and `onembed` are set to `NULL`, all other stride information is ignored, and default strides are used. The default assumes contiguous data arrays.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// If `cufftXtSetGPUs()` was called prior to this call with multiple GPUs, then `workSize` will contain multiple sizes. See sections on multiple GPUs for more details.
    ///
    /// All arrays are assumed to be in CPU memory.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension, `n\[0\]` being the size of the outermost and `n\[rank-1\]` innermost (contiguous) dimension of a transform. For multiple GPUs and rank equal to 1, the sizes must be a power of 2. For multiple GPUs and rank equal to 2 or 3, the sizes must be factorable into primes less than or equal to 127.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory, `inembed\[0\]` being the storage dimension of the outermost dimension. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory, `onembed\[0\]` being the storage dimension of the outermost dimension. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size(s) of the work areas.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked or multi-GPU restrictions are not met.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftMakePlanMany(
        plan: cufftHandle,
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_int,
        inembed: *mut ::core::ffi::c_int,
        istride: ::core::ffi::c_int,
        idist: ::core::ffi::c_int,
        onembed: *mut ::core::ffi::c_int,
        ostride: ::core::ffi::c_int,
        odist: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Following a call to [`cufftCreate`] makes a FFT plan configuration of dimension `rank`, with sizes specified in the array `n`. The `batch` input parameter tells cuFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
    ///
    /// This API is identical to [`cufftMakePlanMany`] except that the arguments specifying sizes and strides are 64 bit integers. This API makes very large transforms possible. cuFFT includes kernels that use 32 bit indexes, and kernels that use 64 bit indexes. cuFFT planning selects 32 bit kernels whenever possible to avoid any overhead due to 64 bit arithmetic.
    ///
    /// All sizes and types of transform are supported by this interface, with two exceptions. For transforms whose size exceeds 4G elements, the dimensions specified in the array `n` must be factorable into primes that are less than or equal to 127. For real to complex and complex to real transforms whose size exceeds 4G elements, the fastest changing dimension must be even.
    ///
    /// The `cufftPlanMany64()` API supports more complicated input and output data layouts via the advanced data layout parameters: `inembed`, `istride`, `idist`, `onembed`, `ostride`, and `odist`.
    ///
    /// If `inembed` and `onembed` are set to `NULL`, all other stride information is ignored, and default strides are used. The default assumes contiguous data arrays.
    ///
    /// This call can only be used once for a given handle. It will fail and return [`cufftResult::CUFFT_INVALID_PLAN`] if the plan is locked, i.e. the handle was previously used with a different `cufftPlan` or `cufftMakePlan` call.
    ///
    /// If `cufftXtSetGPUs()` was called prior to this call with multiple GPUs, then `workSize` will contain multiple sizes. See sections on multiple GPUs for more details.
    ///
    /// All arrays are assumed to be in CPU memory.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension. For multiple GPUs and rank equal to 1, the sizes must be a power of 2. For multiple GPUs and rank equal to 2 or 3, the sizes must be factorable into primes less than or equal to 127.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size(s) of the work areas.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle. Handle is not valid when the plan is locked or multi-GPU restrictions are not met.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftMakePlanMany64(
        plan: cufftHandle,
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_longlong,
        inembed: *mut ::core::ffi::c_longlong,
        istride: ::core::ffi::c_longlong,
        idist: ::core::ffi::c_longlong,
        onembed: *mut ::core::ffi::c_longlong,
        ostride: ::core::ffi::c_longlong,
        odist: ::core::ffi::c_longlong,
        type_: cufftType,
        batch: ::core::ffi::c_longlong,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// This call gives a more accurate estimate of the work area size required for a plan than `cufftEstimateSizeMany()`, given the specified parameters, and taking into account any plan settings that may have been made. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// This API is identical to [`cufftMakePlanMany`] except that the arguments specifying sizes and strides are 64 bit integers. This API makes very large transforms possible. cuFFT includes kernels that use 32 bit indexes, and kernels that use 64 bit indexes. cuFFT planning selects 32 bit kernels whenever possible to avoid any overhead due to 64 bit arithmetic.
    ///
    /// All sizes and types of transform are supported by this interface, with two exceptions. For transforms whose total size exceeds 4G elements, the dimensions specified in the array `n` must be factorable into primes that are less than or equal to 127. For real to complex and complex to real transforms whose total size exceeds 4G elements, the fastest changing dimension must be even.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size of the work area.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSizeMany64(
        plan: cufftHandle,
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_longlong,
        inembed: *mut ::core::ffi::c_longlong,
        istride: ::core::ffi::c_longlong,
        idist: ::core::ffi::c_longlong,
        onembed: *mut ::core::ffi::c_longlong,
        ostride: ::core::ffi::c_longlong,
        odist: ::core::ffi::c_longlong,
        type_: cufftType,
        batch: ::core::ffi::c_longlong,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// During plan execution, cuFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size (e.g. 256 for a 256-point FFT).
    /// - `batch`: Number of transforms of size `nx`. Please consider using [`cufftEstimateMany`] for multiple transforms.
    /// - `workSize`: Pointer to the size, in bytes, of the work space.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: The `nx` parameter is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftEstimate1d(
        nx: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// During plan execution, cuFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size in the *x* dimension (number of rows).
    /// - `ny`: The transform size in the *y* dimension (number of columns).
    /// - `workSize`: Pointer to the size, in bytes, of the work space.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: Either or both of the `nx` or `ny` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftEstimate2d(
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// During plan execution, cuFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size in the *x* dimension.
    /// - `ny`: The transform size in the *y* dimension.
    /// - `nz`: The transform size in the *z* dimension.
    /// - `workSize`: Pointer to the size, in bytes, of the work space.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the `nx`, `ny`, or `nz` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftEstimate3d(
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        nz: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// During plan execution, cuFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// The [`cufftEstimateMany`] API supports more complicated input and output data layouts via the advanced data layout parameters: `inembed`, `istride`, `idist`, `onembed`, `ostride`, and `odist`.
    ///
    /// All arrays are assumed to be in CPU memory.
    ///
    /// # Parameters
    ///
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    /// - `workSize`: Pointer to the size, in bytes, of the work space.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_MISSING_DEPENDENCY`]: The cuFFT library was unable to find a dependency either because it is missing or the version found is incompatible.
    /// - [`cufftResult::CUFFT_NVJITLINK_FAILURE`]: nvJitLink encountered an error during planning.
    /// - [`cufftResult::CUFFT_NVRTC_FAILURE`]: NVRTC encountered an error during planning.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftEstimateMany(
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_int,
        inembed: *mut ::core::ffi::c_int,
        istride: ::core::ffi::c_int,
        idist: ::core::ffi::c_int,
        onembed: *mut ::core::ffi::c_int,
        ostride: ::core::ffi::c_int,
        odist: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Creates only an opaque handle, and allocates small data structures on the host. The `cufftMakePlan*()` calls actually do the plan generation.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully created the FFT plan.
    pub fn cufftCreate(handle: *mut cufftHandle) -> cufftResult;
}
unsafe extern "C" {
    /// This call gives a more accurate estimate of the work area size required for a plan than [`cufftEstimate1d`], given the specified parameters, and taking into account any plan settings that may have been made. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size (e.g. 256 for a 256-point FFT).
    /// - `batch`: Number of transforms of size `nx`. Please consider using [`cufftGetSizeMany`] for multiple transforms.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: The `nx` parameter is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSize1d(
        handle: cufftHandle,
        nx: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// This call gives a more accurate estimate of the work area size required for a plan than [`cufftEstimate2d`], given the specified parameters, and taking into account any plan settings that may have been made. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size in the *x* dimension (number of rows).
    /// - `ny`: The transform size in the *y* dimension (number of columns).
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: Either or both of the `nx` or `ny` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSize2d(
        handle: cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// This call gives a more accurate estimate of the work area size required for a plan than [`cufftEstimate3d`], given the specified parameters, and taking into account any plan settings that may have been made. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `nx`: The transform size in the *x* dimension.
    /// - `ny`: The transform size in the *y* dimension.
    /// - `nz`: The transform size in the *z* dimension.
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size of the work space.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the `nx`, `ny`, or `nz` parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSize3d(
        handle: cufftHandle,
        nx: ::core::ffi::c_int,
        ny: ::core::ffi::c_int,
        nz: ::core::ffi::c_int,
        type_: cufftType,
        workSize: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// This call gives a more accurate estimate of the work area size required for a plan than `cufftEstimateSizeMany()`, given the specified parameters, and taking into account any plan settings that may have been made. If a work area size of 0 is returned it means no temporary storage is needed for evaluation.
    ///
    /// # Parameters
    ///
    /// - `rank`: Dimensionality of the transform (1, 2, or 3).
    /// - `n`: Array of size `rank`, describing the size of each dimension.
    /// - `inembed`: Pointer of size `rank` that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `istride`: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
    /// - `idist`: Indicates the distance between the first element of two consecutive signals in a batch of the input data.
    /// - `onembed`: Pointer of size `rank` that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored.
    /// - `ostride`: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
    /// - `odist`: Indicates the distance between the first element of two consecutive signals in a batch of the output data.
    /// - `batch`: Batch size for this transform.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_ALLOC_FAILED`]: The allocation of GPU resources for the plan failed.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_SIZE`]: One or more of the parameters is not a supported size.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: One or more invalid parameters were passed to the API.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSizeMany(
        handle: cufftHandle,
        rank: ::core::ffi::c_int,
        n: *mut ::core::ffi::c_int,
        inembed: *mut ::core::ffi::c_int,
        istride: ::core::ffi::c_int,
        idist: ::core::ffi::c_int,
        onembed: *mut ::core::ffi::c_int,
        ostride: ::core::ffi::c_int,
        odist: ::core::ffi::c_int,
        type_: cufftType,
        batch: ::core::ffi::c_int,
        workArea: *mut size_t,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Once plan generation has been done, either with the original API or the extensible API, this call returns the actual size of the work area required to support the plan. Callers who choose to manage work area allocation within their application must use this call after plan generation, and after any `cufftSet*()` calls subsequent to plan generation, if those calls might alter the required work space size.
    ///
    /// # Parameters
    ///
    /// - `workSize`: Pointer to the size(s), in bytes, of the work areas. For example for two GPUs worksize must be declared to have two elements.
    ///
    /// Pointer to the size of the work area.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftGetSize(handle: cufftHandle, workSize: *mut size_t) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftSetWorkArea`] overrides the work area pointer associated with a plan. If the work area was auto-allocated, cuFFT frees the auto-allocated space. The `cufftExec*()` calls assume that the work area pointer is valid and that it points to a contiguous region in device memory that does not overlap with any other work area. If this is not the case, results are indeterminate.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `workArea`: Pointer to `workArea`. For multiple GPUs, multiple work area pointers must be given.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftSetWorkArea(
        plan: cufftHandle,
        workArea: *mut ::core::ffi::c_void,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftSetAutoAllocation`] indicates that the caller intends to allocate and manage work areas for plans that have been generated. cuFFT default behavior is to allocate the work area at plan generation time. If [`cufftSetAutoAllocation`] has been called with autoAllocate set to 0 (“false”) prior to one of the `cufftMakePlan*()` calls, cuFFT does not allocate the work area. This is the preferred sequence for callers wishing to manage work area allocation.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `autoAllocate`: Indicates whether to allocate work area.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftSetAutoAllocation(
        plan: cufftHandle,
        autoAllocate: ::core::ffi::c_int,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecC2C`] ([`cufftExecZ2Z`]) executes a single-precision (double-precision) complex-to-complex transform plan in the transform direction as specified by `direction` parameter. cuFFT uses the GPU memory pointed to by the `idata` parameter as input data. This function stores the Fourier coefficients in the `odata` array. If `idata` and `odata` are the same, this method does an in-place transform.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the complex input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the complex output data (in GPU memory).
    ///
    /// ontains the complex Fourier coefficients.
    /// - `direction`: The transform direction: [`CUFFT_FORWARD`] or [`CUFFT_INVERSE`].
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata`, `odata`, and `direction` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftExecC2C(
        plan: cufftHandle,
        idata: *mut cufftComplex,
        odata: *mut cufftComplex,
        direction: ::core::ffi::c_int,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecR2C`] ([`cufftExecD2Z`]) executes a single-precision (double-precision) real-to-complex, implicitly forward, cuFFT transform plan. cuFFT uses as input data the GPU memory pointed to by the `idata` parameter. This function stores the nonredundant Fourier coefficients in the `odata` array. Pointers to `idata` and `odata` are both required to be aligned to [`cufftComplex`] data type in single-precision transforms and [`cufftDoubleComplex`] data type in double-precision transforms. If `idata` and `odata` are the same, this method does an in-place transform. Note the data layout differences between in-place and out-of-place transforms as described in Parameter cufftType.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the real input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the complex output data (in GPU memory).
    ///
    /// Contains the complex Fourier coefficients.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata` and `odata` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftExecR2C(
        plan: cufftHandle,
        idata: *mut cufftReal,
        odata: *mut cufftComplex,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecC2R`] ([`cufftExecZ2D`]) executes a single-precision (double-precision) complex-to-real, implicitly inverse, cuFFT transform plan. cuFFT uses as input data the GPU memory pointed to by the `idata` parameter. The input array holds only the nonredundant complex Fourier coefficients. This function stores the real output values in the `odata` array. and pointers are both required to be aligned to [`cufftComplex`] data type in single-precision transforms and [`cufftDoubleComplex`] type in double-precision transforms. If `idata` and `odata` are the same, this method does an in-place transform.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the complex input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the real output data (in GPU memory).
    ///
    /// Contains the real output data.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata` and `odata` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully executed the FFT plan.
    pub fn cufftExecC2R(
        plan: cufftHandle,
        idata: *mut cufftComplex,
        odata: *mut cufftReal,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecC2C`] ([`cufftExecZ2Z`]) executes a single-precision (double-precision) complex-to-complex transform plan in the transform direction as specified by `direction` parameter. cuFFT uses the GPU memory pointed to by the `idata` parameter as input data. This function stores the Fourier coefficients in the `odata` array. If `idata` and `odata` are the same, this method does an in-place transform.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the complex input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the complex output data (in GPU memory).
    ///
    /// ontains the complex Fourier coefficients.
    /// - `direction`: The transform direction: [`CUFFT_FORWARD`] or [`CUFFT_INVERSE`].
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata`, `odata`, and `direction` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftExecZ2Z(
        plan: cufftHandle,
        idata: *mut cufftDoubleComplex,
        odata: *mut cufftDoubleComplex,
        direction: ::core::ffi::c_int,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecR2C`] ([`cufftExecD2Z`]) executes a single-precision (double-precision) real-to-complex, implicitly forward, cuFFT transform plan. cuFFT uses as input data the GPU memory pointed to by the `idata` parameter. This function stores the nonredundant Fourier coefficients in the `odata` array. Pointers to `idata` and `odata` are both required to be aligned to [`cufftComplex`] data type in single-precision transforms and [`cufftDoubleComplex`] data type in double-precision transforms. If `idata` and `odata` are the same, this method does an in-place transform. Note the data layout differences between in-place and out-of-place transforms as described in Parameter cufftType.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the real input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the complex output data (in GPU memory).
    ///
    /// Contains the complex Fourier coefficients.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata` and `odata` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully returned the size of the work space.
    pub fn cufftExecD2Z(
        plan: cufftHandle,
        idata: *mut cufftDoubleReal,
        odata: *mut cufftDoubleComplex,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// [`cufftExecC2R`] ([`cufftExecZ2D`]) executes a single-precision (double-precision) complex-to-real, implicitly inverse, cuFFT transform plan. cuFFT uses as input data the GPU memory pointed to by the `idata` parameter. The input array holds only the nonredundant complex Fourier coefficients. This function stores the real output values in the `odata` array. and pointers are both required to be aligned to [`cufftComplex`] data type in single-precision transforms and [`cufftDoubleComplex`] type in double-precision transforms. If `idata` and `odata` are the same, this method does an in-place transform.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `idata`: Pointer to the complex input data (in GPU memory) to transform.
    /// - `odata`: Pointer to the real output data (in GPU memory).
    ///
    /// Contains the real output data.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_EXEC_FAILED`]: cuFFT failed to execute the transform on the GPU.
    /// - [`cufftResult::CUFFT_INTERNAL_ERROR`]: An internal driver error was detected.
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: At least one of the parameters `idata` and `odata` is not valid.
    /// - [`cufftResult::CUFFT_SETUP_FAILED`]: The cuFFT library failed to initialize.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully executed the FFT plan.
    pub fn cufftExecZ2D(
        plan: cufftHandle,
        idata: *mut cufftDoubleComplex,
        odata: *mut cufftDoubleReal,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Associates a CUDA stream with a cuFFT plan. All kernel launches made during plan execution are now done through the associated stream, enabling overlap with activity in other streams (e.g. data copying). The association remains until the plan is destroyed or the stream is changed with another call to [`cufftSetStream`].
    ///
    /// Note that starting from CUDA 11.2 (cuFFT 10.4.0), [`cufftSetStream`] is supported on multi-GPU plans. When associating a stream with a plan, `cufftXtMemcpy()` remains synchronous across the multiple GPUs. For previous versions of cuFFT, [`cufftSetStream`] will return an error in multiple GPU plans.
    ///
    /// Note that starting from CUDA 12.2 (cuFFT 11.0.8), on multi-GPU plans, `stream` can be associated with any context on any GPU. However, repeated calls to [`cufftSetStream`] with streams from different contexts incur a small time penalty. Optimal performance is obtained when repeated calls to [`cufftSetStream`] use streams from the same CUDA context.
    ///
    /// # Parameters
    ///
    /// - `plan`: The [`cufftHandle`] object to associate with the stream.
    /// - `stream`: A valid CUDA stream created with `cudaStreamCreate()`; `0` for the default stream.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle, or plan is multi-gpu in cuFFT version prior to 10.4.0.
    /// - [`cufftResult::CUFFT_SUCCESS`]: The stream was associated with the plan.
    pub fn cufftSetStream(plan: cufftHandle, stream: cudaStream_t) -> cufftResult;
}
unsafe extern "C" {
    /// Frees all GPU resources associated with a cuFFT plan and destroys the internal plan data structure. This function should be called once a plan is no longer needed, to avoid wasting GPU memory.
    /// In the case of multi-GPU plans, the plan created first should be destroyed last.
    ///
    /// # Parameters
    ///
    /// - `plan`: The [`cufftHandle`] object of the plan to be destroyed.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully destroyed the FFT plan.
    pub fn cufftDestroy(plan: cufftHandle) -> cufftResult;
}
unsafe extern "C" {
    /// Returns the version number of cuFFT.
    ///
    /// # Parameters
    ///
    /// - `version`: Pointer to the version number.
    ///
    /// Contains the version number.
    pub fn cufftGetVersion(version: *mut ::core::ffi::c_int) -> cufftResult;
}
unsafe extern "C" {
    /// Return in `*value` the number for the property described by `type` of the dynamically linked CUFFT library.
    ///
    /// # Parameters
    ///
    /// - `value`: Contains the integer value for the requested property.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_TYPE`]: The property type is not recognized.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: `value` is `NULL`.
    /// - [`cufftResult::CUFFT_SUCCESS`]: The property value was successfully returned.
    pub fn cufftGetProperty(
        type_: libraryPropertyType,
        value: *mut ::core::ffi::c_int,
    ) -> cufftResult;
}
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cufftProperty_t {
    NVFFT_PLAN_PROPERTY_INT64_PATIENT_JIT = 1,
    NVFFT_PLAN_PROPERTY_INT64_MAX_NUM_HOST_THREADS = 2,
}
pub use self::cufftProperty_t as cufftProperty;
unsafe extern "C" {
    /// Associates a cuFFT plan with a property identified by the key `property`. The value for the property is given by value `propertyValueInt64`, which is a signed long long integer.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `property`: The property identifier, of type `cufftPlanProperty`.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: Invalid property or value with which to set the property.
    /// - [`cufftResult::CUFFT_NOT_SUPPORTED`]: The property is not supported, or it cannot be set at the time (e.g. some properties cannot be set after calling a planning routine for the plan, see cuFFT Plan Properties).
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully set the property.
    pub fn cufftSetPlanPropertyInt64(
        plan: cufftHandle,
        property: cufftProperty,
        inputValueInt: ::core::ffi::c_longlong,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Retrieves the property value identified by the key `property` associated with the cuFFT plan `plan`. The value for the property, which is a signed long long integer, is set in the address space pointed by `propertyValueInt64`.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `property`: The property identifier, of type `cufftPlanProperty`.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: Invalid property, or pointer `propertyValueInt64` is null.
    /// - [`cufftResult::CUFFT_NOT_SUPPORTED`]: The property is not supported.
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully retrieved the property value.
    pub fn cufftGetPlanPropertyInt64(
        plan: cufftHandle,
        property: cufftProperty,
        returnPtrValue: *mut ::core::ffi::c_longlong,
    ) -> cufftResult;
}
unsafe extern "C" {
    /// Resets the value of the property identified by the key `property`, associated with the cuFFT plan `plan`, to its default value.
    ///
    /// # Parameters
    ///
    /// - `plan`: [`cufftHandle`] returned by [`cufftCreate`].
    /// - `property`: The property identifier, of type `cufftPlanProperty`.
    ///
    /// # Return value
    ///
    /// - [`cufftResult::CUFFT_INVALID_PLAN`]: The `plan` parameter is not a valid handle.
    /// - [`cufftResult::CUFFT_INVALID_VALUE`]: Invalid property.
    /// - [`cufftResult::CUFFT_NOT_SUPPORTED`]: The property is not supported for `plan`, or cannot be reset at present time (see Behavior column on cuFFT Plan Properties).
    /// - [`cufftResult::CUFFT_SUCCESS`]: cuFFT successfully reset the property value.
    pub fn cufftResetPlanProperty(
        plan: cufftHandle,
        property: cufftProperty,
    ) -> cufftResult;
}