This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
cudart.rs
1456 lines (1294 loc) · 53.8 KB
/
cudart.rs
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
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
use vector_types::*;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum cudaError_t {
Success = 0,
MissingConfiguration = 1,
MemoryAllocation = 2,
InitializationError = 3,
LaunchFailure = 4,
PriorLaunchFailure = 5,
LaunchTimeout = 6,
LaunchOutOfResources = 7,
InvalidDeviceFunction = 8,
InvalidConfiguration = 9,
InvalidDevice = 10,
InvalidValue = 11,
InvalidPitchValue = 12,
InvalidSymbol = 13,
MapBufferObjectFailed = 14,
UnmapBufferObjectFailed = 15,
InvalidHostPointer = 16,
InvalidDevicePointer = 17,
InvalidTexture = 18,
InvalidTextureBinding = 19,
InvalidChannelDescriptor = 20,
InvalidMemcpyDirection = 21,
AddressOfConstant = 22,
TextureFetchFailed = 23,
TextureNotBound = 24,
SynchronizationError = 25,
InvalidFilterSetting = 26,
InvalidNormSetting = 27,
MixedDeviceExecution = 28,
CudartUnloading = 29,
Unknown = 30,
NotYetImplemented = 31,
MemoryValueTooLarge = 32,
InvalidResourceHandle = 33,
NotReady = 34,
InsufficientDriver = 35,
SetOnActiveProcess = 36,
InvalidSurface = 37,
NoDevice = 38,
ECCUncorrectable = 39,
SharedObjectSymbolNotFound = 40,
SharedObjectInitFailed = 41,
UnsupportedLimit = 42,
DuplicateVariableName = 43,
DuplicateTextureName = 44,
DuplicateSurfaceName = 45,
DevicesUnavailable = 46,
InvalidKernelImage = 47,
NoKernelImageForDevice = 48,
IncompatibleDriverContext = 49,
PeerAccessAlreadyEnabled = 50,
PeerAccessNotEnabled = 51,
DeviceAlreadyInUse = 54,
ProfilerDisabled = 55,
ProfilerNotInitialized = 56,
ProfilerAlreadyStarted = 57,
ProfilerAlreadyStopped = 58,
Assert = 59,
TooManyPeers = 60,
HostMemoryAlreadyRegistered = 61,
HostMemoryNotRegistered = 62,
OperatingSystem = 63,
PeerAccessUnsupported = 64,
LaunchMaxDepthExceeded = 65,
LaunchFileScopedTex = 66,
LaunchFileScopedSurf = 67,
SyncDepthExceeded = 68,
LaunchPendingCountExceeded = 69,
NotPermitted = 70,
NotSupported = 71,
HardwareStackError = 72,
IllegalInstruction = 73,
MisalignedAddress = 74,
InvalidAddressSpace = 75,
InvalidPc = 76,
IllegalAddress = 77,
InvalidPtx = 78,
InvalidGraphicsContext = 79,
NvlinkUncorrectable = 80,
JitCompilerNotFound = 81,
CooperativeLaunchTooLarge = 82,
StartupFailure = 127,
ApiFailureBase = 10000,
}
pub const cudaHostAllocDefault: ::std::os::raw::c_uint = 0;
pub const cudaHostAllocPortable: ::std::os::raw::c_uint = 1;
pub const cudaHostAllocMapped: ::std::os::raw::c_uint = 2;
pub const cudaHostAllocWriteCombined: ::std::os::raw::c_uint = 4;
pub const cudaHostRegisterDefault: ::std::os::raw::c_uint = 0;
pub const cudaHostRegisterPortable: ::std::os::raw::c_uint = 1;
pub const cudaHostRegisterMapped: ::std::os::raw::c_uint = 2;
pub const cudaHostRegisterIoMemory: ::std::os::raw::c_uint = 4;
pub const cudaPeerAccessDefault: ::std::os::raw::c_uint = 0;
pub const cudaStreamDefault: ::std::os::raw::c_uint = 0;
pub const cudaStreamNonBlocking: ::std::os::raw::c_uint = 1;
pub const cudaEventDefault: ::std::os::raw::c_uint = 0;
pub const cudaEventBlockingSync: ::std::os::raw::c_uint = 1;
pub const cudaEventDisableTiming: ::std::os::raw::c_uint = 2;
pub const cudaEventInterprocess: ::std::os::raw::c_uint = 4;
pub const cudaDeviceScheduleAuto: ::std::os::raw::c_uint = 0;
pub const cudaDeviceScheduleSpin: ::std::os::raw::c_uint = 1;
pub const cudaDeviceScheduleYield: ::std::os::raw::c_uint = 2;
pub const cudaDeviceScheduleBlockingSync: ::std::os::raw::c_uint = 4;
pub const cudaDeviceBlockingSync: ::std::os::raw::c_uint = 4;
pub const cudaDeviceScheduleMask: ::std::os::raw::c_uint = 7;
pub const cudaDeviceMapHost: ::std::os::raw::c_uint = 8;
pub const cudaDeviceLmemResizeToMax: ::std::os::raw::c_uint = 16;
pub const cudaDeviceMask: ::std::os::raw::c_uint = 31;
pub const cudaArrayDefault: ::std::os::raw::c_uint = 0;
pub const cudaArrayLayered: ::std::os::raw::c_uint = 1;
pub const cudaArraySurfaceLoadStore: ::std::os::raw::c_uint = 2;
pub const cudaArrayCubemap: ::std::os::raw::c_uint = 4;
pub const cudaArrayTextureGather: ::std::os::raw::c_uint = 8;
pub const cudaIpcMemLazyEnablePeerAccess: ::std::os::raw::c_uint = 1;
pub const cudaMemAttachGlobal: ::std::os::raw::c_uint = 1;
pub const cudaMemAttachHost: ::std::os::raw::c_uint = 2;
pub const cudaMemAttachSingle: ::std::os::raw::c_uint = 4;
pub const cudaOccupancyDefault: ::std::os::raw::c_uint = 0;
pub const cudaOccupancyDisableCachingOverride: ::std::os::raw::c_uint = 1;
pub const cudaCooperativeLaunchMultiDeviceNoPreSync: ::std::os::raw::c_uint = 1;
pub const cudaCooperativeLaunchMultiDeviceNoPostSync: ::std::os::raw::c_uint = 2;
pub const CUDA_IPC_HANDLE_SIZE: ::std::os::raw::c_uint = 64;
pub const cudaSurfaceType1D: ::std::os::raw::c_uint = 1;
pub const cudaSurfaceType2D: ::std::os::raw::c_uint = 2;
pub const cudaSurfaceType3D: ::std::os::raw::c_uint = 3;
pub const cudaSurfaceTypeCubemap: ::std::os::raw::c_uint = 12;
pub const cudaSurfaceType1DLayered: ::std::os::raw::c_uint = 241;
pub const cudaSurfaceType2DLayered: ::std::os::raw::c_uint = 242;
pub const cudaSurfaceTypeCubemapLayered: ::std::os::raw::c_uint = 252;
pub const cudaTextureType1D: ::std::os::raw::c_uint = 1;
pub const cudaTextureType2D: ::std::os::raw::c_uint = 2;
pub const cudaTextureType3D: ::std::os::raw::c_uint = 3;
pub const cudaTextureTypeCubemap: ::std::os::raw::c_uint = 12;
pub const cudaTextureType1DLayered: ::std::os::raw::c_uint = 241;
pub const cudaTextureType2DLayered: ::std::os::raw::c_uint = 242;
pub const cudaTextureTypeCubemapLayered: ::std::os::raw::c_uint = 252;
pub const CUDART_VERSION: ::std::os::raw::c_uint = 9000;
pub const cudaRoundMode_cudaRoundNearest: cudaRoundMode = 0;
pub const cudaRoundMode_cudaRoundZero: cudaRoundMode = 1;
pub const cudaRoundMode_cudaRoundPosInf: cudaRoundMode = 2;
pub const cudaRoundMode_cudaRoundMinInf: cudaRoundMode = 3;
pub type cudaRoundMode = ::std::os::raw::c_uint;
pub const cudaChannelFormatKind_cudaChannelFormatKindSigned: cudaChannelFormatKind = 0;
pub const cudaChannelFormatKind_cudaChannelFormatKindUnsigned: cudaChannelFormatKind = 1;
pub const cudaChannelFormatKind_cudaChannelFormatKindFloat: cudaChannelFormatKind = 2;
pub const cudaChannelFormatKind_cudaChannelFormatKindNone: cudaChannelFormatKind = 3;
pub type cudaChannelFormatKind = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaChannelFormatDesc {
pub x: ::std::os::raw::c_int,
pub y: ::std::os::raw::c_int,
pub z: ::std::os::raw::c_int,
pub w: ::std::os::raw::c_int,
pub f: cudaChannelFormatKind,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaArray {
_unused: [u8; 0],
}
pub type cudaArray_t = *mut cudaArray;
pub type cudaArray_const_t = *const cudaArray;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaMipmappedArray {
_unused: [u8; 0],
}
pub type cudaMipmappedArray_t = *mut cudaMipmappedArray;
pub type cudaMipmappedArray_const_t = *const cudaMipmappedArray;
pub const cudaMemoryType_cudaMemoryTypeHost: cudaMemoryType = 1;
pub const cudaMemoryType_cudaMemoryTypeDevice: cudaMemoryType = 2;
pub type cudaMemoryType = ::std::os::raw::c_uint;
pub const cudaMemcpyKind_cudaMemcpyHostToHost: cudaMemcpyKind = 0;
pub const cudaMemcpyKind_cudaMemcpyHostToDevice: cudaMemcpyKind = 1;
pub const cudaMemcpyKind_cudaMemcpyDeviceToHost: cudaMemcpyKind = 2;
pub const cudaMemcpyKind_cudaMemcpyDeviceToDevice: cudaMemcpyKind = 3;
pub const cudaMemcpyKind_cudaMemcpyDefault: cudaMemcpyKind = 4;
pub type cudaMemcpyKind = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaPitchedPtr {
pub ptr: *mut ::std::os::raw::c_void,
pub pitch: usize,
pub xsize: usize,
pub ysize: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaExtent {
pub width: usize,
pub height: usize,
pub depth: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaPos {
pub x: usize,
pub y: usize,
pub z: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaMemcpy3DParms {
pub srcArray: cudaArray_t,
pub srcPos: cudaPos,
pub srcPtr: cudaPitchedPtr,
pub dstArray: cudaArray_t,
pub dstPos: cudaPos,
pub dstPtr: cudaPitchedPtr,
pub extent: cudaExtent,
pub kind: cudaMemcpyKind,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaMemcpy3DPeerParms {
pub srcArray: cudaArray_t,
pub srcPos: cudaPos,
pub srcPtr: cudaPitchedPtr,
pub srcDevice: ::std::os::raw::c_int,
pub dstArray: cudaArray_t,
pub dstPos: cudaPos,
pub dstPtr: cudaPitchedPtr,
pub dstDevice: ::std::os::raw::c_int,
pub extent: cudaExtent,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaGraphicsResource {
_unused: [u8; 0],
}
pub const cudaGraphicsRegisterFlags_cudaGraphicsRegisterFlagsNone: cudaGraphicsRegisterFlags = 0;
pub const cudaGraphicsRegisterFlags_cudaGraphicsRegisterFlagsReadOnly: cudaGraphicsRegisterFlags = 1;
pub const cudaGraphicsRegisterFlags_cudaGraphicsRegisterFlagsWriteDiscard: cudaGraphicsRegisterFlags = 2;
pub const cudaGraphicsRegisterFlags_cudaGraphicsRegisterFlagsSurfaceLoadStore: cudaGraphicsRegisterFlags = 4;
pub const cudaGraphicsRegisterFlags_cudaGraphicsRegisterFlagsTextureGather: cudaGraphicsRegisterFlags = 8;
pub type cudaGraphicsRegisterFlags = ::std::os::raw::c_uint;
pub const cudaGraphicsMapFlags_cudaGraphicsMapFlagsNone: cudaGraphicsMapFlags = 0;
pub const cudaGraphicsMapFlags_cudaGraphicsMapFlagsReadOnly: cudaGraphicsMapFlags = 1;
pub const cudaGraphicsMapFlags_cudaGraphicsMapFlagsWriteDiscard: cudaGraphicsMapFlags = 2;
pub type cudaGraphicsMapFlags = ::std::os::raw::c_uint;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFacePositiveX: cudaGraphicsCubeFace = 0;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFaceNegativeX: cudaGraphicsCubeFace = 1;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFacePositiveY: cudaGraphicsCubeFace = 2;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFaceNegativeY: cudaGraphicsCubeFace = 3;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFacePositiveZ: cudaGraphicsCubeFace = 4;
pub const cudaGraphicsCubeFace_cudaGraphicsCubeFaceNegativeZ: cudaGraphicsCubeFace = 5;
pub type cudaGraphicsCubeFace = ::std::os::raw::c_uint;
pub const cudaResourceType_cudaResourceTypeArray: cudaResourceType = 0;
pub const cudaResourceType_cudaResourceTypeMipmappedArray: cudaResourceType = 1;
pub const cudaResourceType_cudaResourceTypeLinear: cudaResourceType = 2;
pub const cudaResourceType_cudaResourceTypePitch2D: cudaResourceType = 3;
pub type cudaResourceType = ::std::os::raw::c_uint;
pub const cudaResourceViewFormat_cudaResViewFormatNone: cudaResourceViewFormat = 0;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedChar1: cudaResourceViewFormat = 1;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedChar2: cudaResourceViewFormat = 2;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedChar4: cudaResourceViewFormat = 3;
pub const cudaResourceViewFormat_cudaResViewFormatSignedChar1: cudaResourceViewFormat = 4;
pub const cudaResourceViewFormat_cudaResViewFormatSignedChar2: cudaResourceViewFormat = 5;
pub const cudaResourceViewFormat_cudaResViewFormatSignedChar4: cudaResourceViewFormat = 6;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedShort1: cudaResourceViewFormat = 7;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedShort2: cudaResourceViewFormat = 8;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedShort4: cudaResourceViewFormat = 9;
pub const cudaResourceViewFormat_cudaResViewFormatSignedShort1: cudaResourceViewFormat = 10;
pub const cudaResourceViewFormat_cudaResViewFormatSignedShort2: cudaResourceViewFormat = 11;
pub const cudaResourceViewFormat_cudaResViewFormatSignedShort4: cudaResourceViewFormat = 12;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedInt1: cudaResourceViewFormat = 13;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedInt2: cudaResourceViewFormat = 14;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedInt4: cudaResourceViewFormat = 15;
pub const cudaResourceViewFormat_cudaResViewFormatSignedInt1: cudaResourceViewFormat = 16;
pub const cudaResourceViewFormat_cudaResViewFormatSignedInt2: cudaResourceViewFormat = 17;
pub const cudaResourceViewFormat_cudaResViewFormatSignedInt4: cudaResourceViewFormat = 18;
pub const cudaResourceViewFormat_cudaResViewFormatHalf1: cudaResourceViewFormat = 19;
pub const cudaResourceViewFormat_cudaResViewFormatHalf2: cudaResourceViewFormat = 20;
pub const cudaResourceViewFormat_cudaResViewFormatHalf4: cudaResourceViewFormat = 21;
pub const cudaResourceViewFormat_cudaResViewFormatFloat1: cudaResourceViewFormat = 22;
pub const cudaResourceViewFormat_cudaResViewFormatFloat2: cudaResourceViewFormat = 23;
pub const cudaResourceViewFormat_cudaResViewFormatFloat4: cudaResourceViewFormat = 24;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed1: cudaResourceViewFormat = 25;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed2: cudaResourceViewFormat = 26;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed3: cudaResourceViewFormat = 27;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed4: cudaResourceViewFormat = 28;
pub const cudaResourceViewFormat_cudaResViewFormatSignedBlockCompressed4: cudaResourceViewFormat = 29;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed5: cudaResourceViewFormat = 30;
pub const cudaResourceViewFormat_cudaResViewFormatSignedBlockCompressed5: cudaResourceViewFormat = 31;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed6H: cudaResourceViewFormat = 32;
pub const cudaResourceViewFormat_cudaResViewFormatSignedBlockCompressed6H: cudaResourceViewFormat = 33;
pub const cudaResourceViewFormat_cudaResViewFormatUnsignedBlockCompressed7: cudaResourceViewFormat = 34;
pub type cudaResourceViewFormat = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct cudaResourceDesc {
pub resType: cudaResourceType,
pub res: cudaResourceDesc__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union cudaResourceDesc__bindgen_ty_1 {
pub array: cudaResourceDesc__bindgen_ty_1__bindgen_ty_1,
pub mipmap: cudaResourceDesc__bindgen_ty_1__bindgen_ty_2,
pub linear: cudaResourceDesc__bindgen_ty_1__bindgen_ty_3,
pub pitch2D: cudaResourceDesc__bindgen_ty_1__bindgen_ty_4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_1 {
pub array: cudaArray_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_2 {
pub mipmap: cudaMipmappedArray_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_3 {
pub devPtr: *mut ::std::os::raw::c_void,
pub desc: cudaChannelFormatDesc,
pub sizeInBytes: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaResourceDesc__bindgen_ty_1__bindgen_ty_4 {
pub devPtr: *mut ::std::os::raw::c_void,
pub desc: cudaChannelFormatDesc,
pub width: usize,
pub height: usize,
pub pitchInBytes: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaResourceViewDesc {
pub format: cudaResourceViewFormat,
pub width: usize,
pub height: usize,
pub depth: usize,
pub firstMipmapLevel: ::std::os::raw::c_uint,
pub lastMipmapLevel: ::std::os::raw::c_uint,
pub firstLayer: ::std::os::raw::c_uint,
pub lastLayer: ::std::os::raw::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaPointerAttributes {
pub memoryType: cudaMemoryType,
pub device: ::std::os::raw::c_int,
pub devicePointer: *mut ::std::os::raw::c_void,
pub hostPointer: *mut ::std::os::raw::c_void,
pub isManaged: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaFuncAttributes {
pub sharedSizeBytes: usize,
pub constSizeBytes: usize,
pub localSizeBytes: usize,
pub maxThreadsPerBlock: ::std::os::raw::c_int,
pub numRegs: ::std::os::raw::c_int,
pub ptxVersion: ::std::os::raw::c_int,
pub binaryVersion: ::std::os::raw::c_int,
pub cacheModeCA: ::std::os::raw::c_int,
pub maxDynamicSharedSizeBytes: ::std::os::raw::c_int,
pub preferredShmemCarveout: ::std::os::raw::c_int,
}
pub const cudaFuncAttribute_cudaFuncAttributeMaxDynamicSharedMemorySize: cudaFuncAttribute = 8;
pub const cudaFuncAttribute_cudaFuncAttributePreferredSharedMemoryCarveout: cudaFuncAttribute = 9;
pub const cudaFuncAttribute_cudaFuncAttributeMax: cudaFuncAttribute = 10;
pub type cudaFuncAttribute = ::std::os::raw::c_uint;
pub const cudaFuncCache_cudaFuncCachePreferNone: cudaFuncCache = 0;
pub const cudaFuncCache_cudaFuncCachePreferShared: cudaFuncCache = 1;
pub const cudaFuncCache_cudaFuncCachePreferL1: cudaFuncCache = 2;
pub const cudaFuncCache_cudaFuncCachePreferEqual: cudaFuncCache = 3;
pub type cudaFuncCache = ::std::os::raw::c_uint;
pub const cudaSharedMemConfig_cudaSharedMemBankSizeDefault: cudaSharedMemConfig = 0;
pub const cudaSharedMemConfig_cudaSharedMemBankSizeFourByte: cudaSharedMemConfig = 1;
pub const cudaSharedMemConfig_cudaSharedMemBankSizeEightByte: cudaSharedMemConfig = 2;
pub type cudaSharedMemConfig = ::std::os::raw::c_uint;
pub const cudaSharedCarveout_cudaSharedmemCarveoutDefault: cudaSharedCarveout = -1;
pub const cudaSharedCarveout_cudaSharedmemCarveoutMaxShared: cudaSharedCarveout = 100;
pub const cudaSharedCarveout_cudaSharedmemCarveoutMaxL1: cudaSharedCarveout = 0;
pub type cudaSharedCarveout = ::std::os::raw::c_int;
#[repr(i32)]
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum cudaComputeMode {
Default = 0,
Exclusive = 1,
Prohibited = 2,
ExclusiveProcess = 3,
}
pub const cudaLimit_cudaLimitStackSize: cudaLimit = 0;
pub const cudaLimit_cudaLimitPrintfFifoSize: cudaLimit = 1;
pub const cudaLimit_cudaLimitMallocHeapSize: cudaLimit = 2;
pub const cudaLimit_cudaLimitDevRuntimeSyncDepth: cudaLimit = 3;
pub const cudaLimit_cudaLimitDevRuntimePendingLaunchCount: cudaLimit = 4;
pub type cudaLimit = ::std::os::raw::c_uint;
pub const cudaMemoryAdvise_cudaMemAdviseSetReadMostly: cudaMemoryAdvise = 1;
pub const cudaMemoryAdvise_cudaMemAdviseUnsetReadMostly: cudaMemoryAdvise = 2;
pub const cudaMemoryAdvise_cudaMemAdviseSetPreferredLocation: cudaMemoryAdvise = 3;
pub const cudaMemoryAdvise_cudaMemAdviseUnsetPreferredLocation: cudaMemoryAdvise = 4;
pub const cudaMemoryAdvise_cudaMemAdviseSetAccessedBy: cudaMemoryAdvise = 5;
pub const cudaMemoryAdvise_cudaMemAdviseUnsetAccessedBy: cudaMemoryAdvise = 6;
pub type cudaMemoryAdvise = ::std::os::raw::c_uint;
pub const cudaMemRangeAttribute_cudaMemRangeAttributeReadMostly: cudaMemRangeAttribute = 1;
pub const cudaMemRangeAttribute_cudaMemRangeAttributePreferredLocation: cudaMemRangeAttribute = 2;
pub const cudaMemRangeAttribute_cudaMemRangeAttributeAccessedBy: cudaMemRangeAttribute = 3;
pub const cudaMemRangeAttribute_cudaMemRangeAttributeLastPrefetchLocation: cudaMemRangeAttribute = 4;
pub type cudaMemRangeAttribute = ::std::os::raw::c_uint;
pub const cudaOutputMode_cudaKeyValuePair: cudaOutputMode = 0;
pub const cudaOutputMode_cudaCSV: cudaOutputMode = 1;
pub type cudaOutputMode = ::std::os::raw::c_uint;
pub const cudaDeviceP2PAttr_cudaDevP2PAttrPerformanceRank: cudaDeviceP2PAttr = 1;
pub const cudaDeviceP2PAttr_cudaDevP2PAttrAccessSupported: cudaDeviceP2PAttr = 2;
pub const cudaDeviceP2PAttr_cudaDevP2PAttrNativeAtomicSupported: cudaDeviceP2PAttr = 3;
pub type cudaDeviceP2PAttr = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct cudaDeviceProp {
pub name: [::std::os::raw::c_char; 256usize],
pub totalGlobalMem: usize,
pub sharedMemPerBlock: usize,
pub regsPerBlock: ::std::os::raw::c_int,
pub warpSize: ::std::os::raw::c_int,
pub memPitch: usize,
pub maxThreadsPerBlock: ::std::os::raw::c_int,
pub maxThreadsDim: [::std::os::raw::c_int; 3usize],
pub maxGridSize: [::std::os::raw::c_int; 3usize],
pub clockRate: ::std::os::raw::c_int,
pub totalConstMem: usize,
pub major: ::std::os::raw::c_int,
pub minor: ::std::os::raw::c_int,
pub textureAlignment: usize,
pub texturePitchAlignment: usize,
pub deviceOverlap: ::std::os::raw::c_int,
pub multiProcessorCount: ::std::os::raw::c_int,
pub kernelExecTimeoutEnabled: ::std::os::raw::c_int,
pub integrated: ::std::os::raw::c_int,
pub canMapHostMemory: ::std::os::raw::c_int,
pub computeMode: cudaComputeMode,
pub maxTexture1D: ::std::os::raw::c_int,
pub maxTexture1DMipmap: ::std::os::raw::c_int,
pub maxTexture1DLinear: ::std::os::raw::c_int,
pub maxTexture2D: [::std::os::raw::c_int; 2usize],
pub maxTexture2DMipmap: [::std::os::raw::c_int; 2usize],
pub maxTexture2DLinear: [::std::os::raw::c_int; 3usize],
pub maxTexture2DGather: [::std::os::raw::c_int; 2usize],
pub maxTexture3D: [::std::os::raw::c_int; 3usize],
pub maxTexture3DAlt: [::std::os::raw::c_int; 3usize],
pub maxTextureCubemap: ::std::os::raw::c_int,
pub maxTexture1DLayered: [::std::os::raw::c_int; 2usize],
pub maxTexture2DLayered: [::std::os::raw::c_int; 3usize],
pub maxTextureCubemapLayered: [::std::os::raw::c_int; 2usize],
pub maxSurface1D: ::std::os::raw::c_int,
pub maxSurface2D: [::std::os::raw::c_int; 2usize],
pub maxSurface3D: [::std::os::raw::c_int; 3usize],
pub maxSurface1DLayered: [::std::os::raw::c_int; 2usize],
pub maxSurface2DLayered: [::std::os::raw::c_int; 3usize],
pub maxSurfaceCubemap: ::std::os::raw::c_int,
pub maxSurfaceCubemapLayered: [::std::os::raw::c_int; 2usize],
pub surfaceAlignment: usize,
pub concurrentKernels: ::std::os::raw::c_int,
pub ECCEnabled: ::std::os::raw::c_int,
pub pciBusID: ::std::os::raw::c_int,
pub pciDeviceID: ::std::os::raw::c_int,
pub pciDomainID: ::std::os::raw::c_int,
pub tccDriver: ::std::os::raw::c_int,
pub asyncEngineCount: ::std::os::raw::c_int,
pub unifiedAddressing: ::std::os::raw::c_int,
pub memoryClockRate: ::std::os::raw::c_int,
pub memoryBusWidth: ::std::os::raw::c_int,
pub l2CacheSize: ::std::os::raw::c_int,
pub maxThreadsPerMultiProcessor: ::std::os::raw::c_int,
pub streamPrioritiesSupported: ::std::os::raw::c_int,
pub globalL1CacheSupported: ::std::os::raw::c_int,
pub localL1CacheSupported: ::std::os::raw::c_int,
pub sharedMemPerMultiprocessor: usize,
pub regsPerMultiprocessor: ::std::os::raw::c_int,
pub managedMemory: ::std::os::raw::c_int,
pub isMultiGpuBoard: ::std::os::raw::c_int,
pub multiGpuBoardGroupID: ::std::os::raw::c_int,
pub hostNativeAtomicSupported: ::std::os::raw::c_int,
pub singleToDoublePrecisionPerfRatio: ::std::os::raw::c_int,
pub pageableMemoryAccess: ::std::os::raw::c_int,
pub concurrentManagedAccess: ::std::os::raw::c_int,
pub computePreemptionSupported: ::std::os::raw::c_int,
pub canUseHostPointerForRegisteredMem: ::std::os::raw::c_int,
pub cooperativeLaunch: ::std::os::raw::c_int,
pub cooperativeMultiDeviceLaunch: ::std::os::raw::c_int,
pub sharedMemPerBlockOptin: usize,
}
#[repr(u32)]
#[derive(Copy, Clone)]
pub enum cudaDeviceAttr {
MaxThreadsPerBlock = 1,
MaxBlockDimX = 2,
MaxBlockDimY = 3,
MaxBlockDimZ = 4,
MaxGridDimX = 5,
MaxGridDimY = 6,
MaxGridDimZ = 7,
MaxSharedMemoryPerBlock = 8,
TotalConstantMemory = 9,
WarpSize = 10,
MaxPitch = 11,
MaxRegistersPerBlock = 12,
ClockRate = 13,
TextureAlignment = 14,
GpuOverlap = 15,
MultiProcessorCount = 16,
KernelExecTimeout = 17,
Integrated = 18,
CanMapHostMemory = 19,
ComputeMode = 20,
MaxTexture1DWidth = 21,
MaxTexture2DWidth = 22,
MaxTexture2DHeight = 23,
MaxTexture3DWidth = 24,
MaxTexture3DHeight = 25,
MaxTexture3DDepth = 26,
MaxTexture2DLayeredWidth = 27,
MaxTexture2DLayeredHeight = 28,
MaxTexture2DLayeredLayers = 29,
SurfaceAlignment = 30,
ConcurrentKernels = 31,
EccEnabled = 32,
PciBusId = 33,
PciDeviceId = 34,
TccDriver = 35,
MemoryClockRate = 36,
GlobalMemoryBusWidth = 37,
L2CacheSize = 38,
MaxThreadsPerMultiProcessor = 39,
AsyncEngineCount = 40,
UnifiedAddressing = 41,
MaxTexture1DLayeredWidth = 42,
MaxTexture1DLayeredLayers = 43,
MaxTexture2DGatherWidth = 45,
MaxTexture2DGatherHeight = 46,
MaxTexture3DWidthAlt = 47,
MaxTexture3DHeightAlt = 48,
MaxTexture3DDepthAlt = 49,
PciDomainId = 50,
TexturePitchAlignment = 51,
MaxTextureCubemapWidth = 52,
MaxTextureCubemapLayeredWidth = 53,
MaxTextureCubemapLayeredLayers = 54,
MaxSurface1DWidth = 55,
MaxSurface2DWidth = 56,
MaxSurface2DHeight = 57,
MaxSurface3DWidth = 58,
MaxSurface3DHeight = 59,
MaxSurface3DDepth = 60,
MaxSurface1DLayeredWidth = 61,
MaxSurface1DLayeredLayers = 62,
MaxSurface2DLayeredWidth = 63,
MaxSurface2DLayeredHeight = 64,
MaxSurface2DLayeredLayers = 65,
MaxSurfaceCubemapWidth = 66,
MaxSurfaceCubemapLayeredWidth = 67,
MaxSurfaceCubemapLayeredLayers = 68,
MaxTexture1DLinearWidth = 69,
MaxTexture2DLinearWidth = 70,
MaxTexture2DLinearHeight = 71,
MaxTexture2DLinearPitch = 72,
MaxTexture2DMipmappedWidth = 73,
MaxTexture2DMipmappedHeight = 74,
ComputeCapabilityMajor = 75,
ComputeCapabilityMinor = 76,
MaxTexture1DMipmappedWidth = 77,
StreamPrioritiesSupported = 78,
GlobalL1CacheSupported = 79,
LocalL1CacheSupported = 80,
MaxSharedMemoryPerMultiprocessor = 81,
MaxRegistersPerMultiprocessor = 82,
ManagedMemory = 83,
IsMultiGpuBoard = 84,
MultiGpuBoardGroupID = 85,
HostNativeAtomicSupported = 86,
SingleToDoublePrecisionPerfRatio = 87,
PageableMemoryAccess = 88,
ConcurrentManagedAccess = 89,
ComputePreemptionSupported = 90,
CanUseHostPointerForRegisteredMem = 91,
Reserved92 = 92,
Reserved93 = 93,
Reserved94 = 94,
CooperativeLaunch = 95,
CooperativeMultiDeviceLaunch = 96,
MaxSharedMemoryPerBlockOptin = 97,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct cudaIpcEventHandle_st {
pub reserved: [::std::os::raw::c_char; 64usize],
}
pub type cudaIpcEventHandle_t = cudaIpcEventHandle_st;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct cudaIpcMemHandle_st {
pub reserved: [::std::os::raw::c_char; 64usize],
}
pub type cudaIpcMemHandle_t = cudaIpcMemHandle_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
_unused: [u8; 0],
}
pub type cudaStream_t = *mut CUstream_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUevent_st {
_unused: [u8; 0],
}
pub type cudaEvent_t = *mut CUevent_st;
pub type cudaGraphicsResource_t = *mut cudaGraphicsResource;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUuuid_st {
_unused: [u8; 0],
}
pub type cudaUUID_t = CUuuid_st;
pub use self::cudaOutputMode as cudaOutputMode_t;
pub const cudaCGScope_cudaCGScopeInvalid: cudaCGScope = 0;
pub const cudaCGScope_cudaCGScopeGrid: cudaCGScope = 1;
pub const cudaCGScope_cudaCGScopeMultiGrid: cudaCGScope = 2;
pub type cudaCGScope = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaLaunchParams {
pub func: *mut ::std::os::raw::c_void,
pub gridDim: dim3,
pub blockDim: dim3,
pub args: *mut *mut ::std::os::raw::c_void,
pub sharedMem: usize,
pub stream: cudaStream_t,
}
pub const cudaSurfaceBoundaryMode_cudaBoundaryModeZero: cudaSurfaceBoundaryMode = 0;
pub const cudaSurfaceBoundaryMode_cudaBoundaryModeClamp: cudaSurfaceBoundaryMode = 1;
pub const cudaSurfaceBoundaryMode_cudaBoundaryModeTrap: cudaSurfaceBoundaryMode = 2;
pub type cudaSurfaceBoundaryMode = ::std::os::raw::c_uint;
pub const cudaSurfaceFormatMode_cudaFormatModeForced: cudaSurfaceFormatMode = 0;
pub const cudaSurfaceFormatMode_cudaFormatModeAuto: cudaSurfaceFormatMode = 1;
pub type cudaSurfaceFormatMode = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct surfaceReference {
pub channelDesc: cudaChannelFormatDesc,
}
pub type cudaSurfaceObject_t = ::std::os::raw::c_ulonglong;
pub const cudaTextureAddressMode_cudaAddressModeWrap: cudaTextureAddressMode = 0;
pub const cudaTextureAddressMode_cudaAddressModeClamp: cudaTextureAddressMode = 1;
pub const cudaTextureAddressMode_cudaAddressModeMirror: cudaTextureAddressMode = 2;
pub const cudaTextureAddressMode_cudaAddressModeBorder: cudaTextureAddressMode = 3;
pub type cudaTextureAddressMode = ::std::os::raw::c_uint;
pub const cudaTextureFilterMode_cudaFilterModePoint: cudaTextureFilterMode = 0;
pub const cudaTextureFilterMode_cudaFilterModeLinear: cudaTextureFilterMode = 1;
pub type cudaTextureFilterMode = ::std::os::raw::c_uint;
pub const cudaTextureReadMode_cudaReadModeElementType: cudaTextureReadMode = 0;
pub const cudaTextureReadMode_cudaReadModeNormalizedFloat: cudaTextureReadMode = 1;
pub type cudaTextureReadMode = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct textureReference {
pub normalized: ::std::os::raw::c_int,
pub filterMode: cudaTextureFilterMode,
pub addressMode: [cudaTextureAddressMode; 3usize],
pub channelDesc: cudaChannelFormatDesc,
pub sRGB: ::std::os::raw::c_int,
pub maxAnisotropy: ::std::os::raw::c_uint,
pub mipmapFilterMode: cudaTextureFilterMode,
pub mipmapLevelBias: f32,
pub minMipmapLevelClamp: f32,
pub maxMipmapLevelClamp: f32,
pub __cudaReserved: [::std::os::raw::c_int; 15usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudaTextureDesc {
pub addressMode: [cudaTextureAddressMode; 3usize],
pub filterMode: cudaTextureFilterMode,
pub readMode: cudaTextureReadMode,
pub sRGB: ::std::os::raw::c_int,
pub borderColor: [f32; 4usize],
pub normalizedCoords: ::std::os::raw::c_int,
pub maxAnisotropy: ::std::os::raw::c_uint,
pub mipmapFilterMode: cudaTextureFilterMode,
pub mipmapLevelBias: f32,
pub minMipmapLevelClamp: f32,
pub maxMipmapLevelClamp: f32,
}
pub type cudaTextureObject_t = ::std::os::raw::c_ulonglong;
pub const cudaDataType_t_CUDA_R_16F: cudaDataType_t = 2;
pub const cudaDataType_t_CUDA_C_16F: cudaDataType_t = 6;
pub const cudaDataType_t_CUDA_R_32F: cudaDataType_t = 0;
pub const cudaDataType_t_CUDA_C_32F: cudaDataType_t = 4;
pub const cudaDataType_t_CUDA_R_64F: cudaDataType_t = 1;
pub const cudaDataType_t_CUDA_C_64F: cudaDataType_t = 5;
pub const cudaDataType_t_CUDA_R_8I: cudaDataType_t = 3;
pub const cudaDataType_t_CUDA_C_8I: cudaDataType_t = 7;
pub const cudaDataType_t_CUDA_R_8U: cudaDataType_t = 8;
pub const cudaDataType_t_CUDA_C_8U: cudaDataType_t = 9;
pub const cudaDataType_t_CUDA_R_32I: cudaDataType_t = 10;
pub const cudaDataType_t_CUDA_C_32I: cudaDataType_t = 11;
pub const cudaDataType_t_CUDA_R_32U: cudaDataType_t = 12;
pub const cudaDataType_t_CUDA_C_32U: cudaDataType_t = 13;
pub type cudaDataType_t = ::std::os::raw::c_uint;
pub use self::cudaDataType_t as cudaDataType;
pub const libraryPropertyType_t_MAJOR_VERSION: libraryPropertyType_t = 0;
pub const libraryPropertyType_t_MINOR_VERSION: libraryPropertyType_t = 1;
pub const libraryPropertyType_t_PATCH_LEVEL: libraryPropertyType_t = 2;
pub type libraryPropertyType_t = ::std::os::raw::c_uint;
pub use self::libraryPropertyType_t as libraryPropertyType;
extern "C" {
pub fn cudaDeviceReset() -> cudaError_t;
pub fn cudaDeviceSynchronize() -> cudaError_t;
pub fn cudaDeviceSetLimit(limit: cudaLimit, value: usize) -> cudaError_t;
pub fn cudaDeviceGetLimit(pValue: *mut usize, limit: cudaLimit) -> cudaError_t;
pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
pub fn cudaDeviceGetStreamPriorityRange(
leastPriority: *mut ::std::os::raw::c_int,
greatestPriority: *mut ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaDeviceSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
pub fn cudaDeviceGetSharedMemConfig(pConfig: *mut cudaSharedMemConfig) -> cudaError_t;
pub fn cudaDeviceSetSharedMemConfig(config: cudaSharedMemConfig) -> cudaError_t;
pub fn cudaDeviceGetByPCIBusId(
device: *mut ::std::os::raw::c_int,
pciBusId: *const ::std::os::raw::c_char,
) -> cudaError_t;
pub fn cudaDeviceGetPCIBusId(
pciBusId: *mut ::std::os::raw::c_char,
len: ::std::os::raw::c_int,
device: ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaIpcGetEventHandle(handle: *mut cudaIpcEventHandle_t, event: cudaEvent_t) -> cudaError_t;
pub fn cudaIpcOpenEventHandle(event: *mut cudaEvent_t, handle: cudaIpcEventHandle_t) -> cudaError_t;
pub fn cudaIpcGetMemHandle(handle: *mut cudaIpcMemHandle_t, devPtr: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaIpcOpenMemHandle(
devPtr: *mut *mut ::std::os::raw::c_void,
handle: cudaIpcMemHandle_t,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaIpcCloseMemHandle(devPtr: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaThreadExit() -> cudaError_t;
pub fn cudaThreadSynchronize() -> cudaError_t;
pub fn cudaThreadSetLimit(limit: cudaLimit, value: usize) -> cudaError_t;
pub fn cudaThreadGetLimit(pValue: *mut usize, limit: cudaLimit) -> cudaError_t;
pub fn cudaThreadGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
pub fn cudaThreadSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
pub fn cudaGetLastError() -> cudaError_t;
pub fn cudaPeekAtLastError() -> cudaError_t;
pub fn cudaGetErrorName(error: cudaError_t) -> *const ::std::os::raw::c_char;
pub fn cudaGetErrorString(error: cudaError_t) -> *const ::std::os::raw::c_char;
pub fn cudaGetDeviceCount(count: *mut ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaGetDeviceProperties(prop: *mut cudaDeviceProp, device: ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaDeviceGetAttribute(
value: *mut ::std::os::raw::c_int,
attr: cudaDeviceAttr,
device: ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaDeviceGetP2PAttribute(
value: *mut ::std::os::raw::c_int,
attr: cudaDeviceP2PAttr,
srcDevice: ::std::os::raw::c_int,
dstDevice: ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaChooseDevice(device: *mut ::std::os::raw::c_int, prop: *const cudaDeviceProp) -> cudaError_t;
pub fn cudaSetDevice(device: ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaGetDevice(device: *mut ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaSetValidDevices(device_arr: *mut ::std::os::raw::c_int, len: ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaSetDeviceFlags(flags: ::std::os::raw::c_uint) -> cudaError_t;
pub fn cudaGetDeviceFlags(flags: *mut ::std::os::raw::c_uint) -> cudaError_t;
pub fn cudaStreamCreate(pStream: *mut cudaStream_t) -> cudaError_t;
pub fn cudaStreamCreateWithFlags(pStream: *mut cudaStream_t, flags: ::std::os::raw::c_uint) -> cudaError_t;
pub fn cudaStreamCreateWithPriority(
pStream: *mut cudaStream_t,
flags: ::std::os::raw::c_uint,
priority: ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaStreamGetPriority(hStream: cudaStream_t, priority: *mut ::std::os::raw::c_int) -> cudaError_t;
pub fn cudaStreamGetFlags(hStream: cudaStream_t, flags: *mut ::std::os::raw::c_uint) -> cudaError_t;
pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t;
pub fn cudaStreamWaitEvent(stream: cudaStream_t, event: cudaEvent_t, flags: ::std::os::raw::c_uint) -> cudaError_t;
}
pub type cudaStreamCallback_t = ::std::option::Option<
unsafe extern "C" fn(stream: cudaStream_t, status: cudaError_t, userData: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn cudaStreamAddCallback(
stream: cudaStream_t,
callback: cudaStreamCallback_t,
userData: *mut ::std::os::raw::c_void,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
pub fn cudaStreamAttachMemAsync(
stream: cudaStream_t,
devPtr: *mut ::std::os::raw::c_void,
length: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
pub fn cudaEventCreateWithFlags(event: *mut cudaEvent_t, flags: ::std::os::raw::c_uint) -> cudaError_t;
pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
pub fn cudaEventElapsedTime(ms: *mut f32, start: cudaEvent_t, end: cudaEvent_t) -> cudaError_t;
pub fn cudaLaunchKernel(
func: *const ::std::os::raw::c_void,
gridDim: dim3,
blockDim: dim3,
args: *mut *mut ::std::os::raw::c_void,
sharedMem: usize,
stream: cudaStream_t,
) -> cudaError_t;
pub fn cudaLaunchCooperativeKernel(
func: *const ::std::os::raw::c_void,
gridDim: dim3,
blockDim: dim3,
args: *mut *mut ::std::os::raw::c_void,
sharedMem: usize,
stream: cudaStream_t,
) -> cudaError_t;
pub fn cudaLaunchCooperativeKernelMultiDevice(
launchParamsList: *mut cudaLaunchParams,
numDevices: ::std::os::raw::c_uint,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaFuncSetCacheConfig(func: *const ::std::os::raw::c_void, cacheConfig: cudaFuncCache) -> cudaError_t;
pub fn cudaFuncSetSharedMemConfig(func: *const ::std::os::raw::c_void, config: cudaSharedMemConfig) -> cudaError_t;
pub fn cudaFuncGetAttributes(attr: *mut cudaFuncAttributes, func: *const ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaFuncSetAttribute(
func: *const ::std::os::raw::c_void,
attr: cudaFuncAttribute,
value: ::std::os::raw::c_int,
) -> cudaError_t;
pub fn cudaSetDoubleForDevice(d: *mut f64) -> cudaError_t;
pub fn cudaSetDoubleForHost(d: *mut f64) -> cudaError_t;
pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessor(
numBlocks: *mut ::std::os::raw::c_int,
func: *const ::std::os::raw::c_void,
blockSize: ::std::os::raw::c_int,
dynamicSMemSize: usize,
) -> cudaError_t;
pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
numBlocks: *mut ::std::os::raw::c_int,
func: *const ::std::os::raw::c_void,
blockSize: ::std::os::raw::c_int,
dynamicSMemSize: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaConfigureCall(gridDim: dim3, blockDim: dim3, sharedMem: usize, stream: cudaStream_t) -> cudaError_t;
pub fn cudaSetupArgument(arg: *const ::std::os::raw::c_void, size: usize, offset: usize) -> cudaError_t;
pub fn cudaLaunch(func: *const ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaMallocManaged(
devPtr: *mut *mut ::std::os::raw::c_void,
size: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaMalloc(devPtr: *mut *mut ::std::os::raw::c_void, size: usize) -> cudaError_t;
pub fn cudaMallocHost(ptr: *mut *mut ::std::os::raw::c_void, size: usize) -> cudaError_t;
pub fn cudaMallocPitch(
devPtr: *mut *mut ::std::os::raw::c_void,
pitch: *mut usize,
width: usize,
height: usize,
) -> cudaError_t;
pub fn cudaMallocArray(
array: *mut cudaArray_t,
desc: *const cudaChannelFormatDesc,
width: usize,
height: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaFree(devPtr: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaFreeHost(ptr: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaFreeArray(array: cudaArray_t) -> cudaError_t;
pub fn cudaFreeMipmappedArray(mipmappedArray: cudaMipmappedArray_t) -> cudaError_t;
pub fn cudaHostAlloc(
pHost: *mut *mut ::std::os::raw::c_void,
size: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaHostRegister(
ptr: *mut ::std::os::raw::c_void,
size: usize,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaHostUnregister(ptr: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaHostGetDevicePointer(
pDevice: *mut *mut ::std::os::raw::c_void,
pHost: *mut ::std::os::raw::c_void,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;
pub fn cudaHostGetFlags(pFlags: *mut ::std::os::raw::c_uint, pHost: *mut ::std::os::raw::c_void) -> cudaError_t;
pub fn cudaMalloc3D(pitchedDevPtr: *mut cudaPitchedPtr, extent: cudaExtent) -> cudaError_t;
pub fn cudaMalloc3DArray(
array: *mut cudaArray_t,
desc: *const cudaChannelFormatDesc,
extent: cudaExtent,
flags: ::std::os::raw::c_uint,
) -> cudaError_t;