Coverage report: /home/ellis/comp/core/ffi/cuda/type.lisp

KindCoveredAll%
expression014 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; type.lisp --- CUDA Types
2
 
3
 ;; CUDA Base Types
4
 
5
 ;;; Code:
6
 (in-package :cuda)
7
 
8
 (define-alien-type cu-device int)
9
 (define-alien-type cu-context (* t))
10
 (define-alien-type cu-module (* t))
11
 (define-alien-type cu-function (* t))
12
 (define-alien-type cu-stream (* t))
13
 (define-alien-type cu-event (* t))
14
 (define-alien-type cu-graphics-resource (* t))
15
 (define-alien-type cu-device-ptr unsigned-long-long)
16
 
17
 (define-alien-enum (cu-event-flag int)
18
                    :default 0
19
                    :blocking-sync 1
20
                    :disable-timing 2
21
                    :interprocess 4)
22
 
23
 (define-alien-enum (cu-stream-flag int)
24
                    :default 0
25
                    :non-blocking 1)
26
 
27
 (define-alien-enum (cu-memhostalloc-flag int)
28
                    :portable 1
29
                    :devicemap 2
30
                    :writecombined 4)
31
 
32
 (define-alien-enum (cu-memhostregister-flag int)
33
                    :portable 1
34
                    :devicemap 2
35
                    :iomemory 4
36
                    :read-only 8)
37
 
38
 (define-alien-enum 
39
     (cu-result int)
40
     ;; The API call returned with no errors. In the case of query calls, this
41
     ;; also means that the operation being queried is complete (see
42
     ;; ::cuEventQuery() and ::cuStreamQuery()).
43
     :success 0
44
     #|
45
      * This indicates that one or more of the parameters passed to the API call
46
      * is not within an acceptable range of values.
47
     |#
48
     :error-invalid-value 1
49
 
50
     #|
51
      * The API call failed because it was unable to allocate enough memory or
52
      * other resources to perform the requested operation.
53
     |#
54
     :error-out-of-memory 2
55
 
56
     #|
57
      * This indicates that the CUDA driver has not been initialized with
58
      * ::cuInit() or that initialization has failed.
59
     |#
60
     :error-not-initialized 3
61
 
62
     #|
63
      * This indicates that the CUDA driver is in the process of shutting down.
64
     |#
65
     :error-deinitialized 4
66
 
67
     #|
68
      * This indicates profiler is not initialized for this run. This can
69
      * happen when the application is running with external profiling tools
70
      * like visual profiler.
71
     |#
72
     :error-profiler-disabled 5
73
 
74
     #|
75
      * \deprecated
76
      * This error return is deprecated as of CUDA 5.0. It is no longer an error
77
      * to attempt to enable/disable the profiling via ::cuProfilerStart or
78
      * ::cuProfilerStop without initialization.
79
     |#
80
     :error-profiler-not-initialized 6
81
 
82
     #|
83
      * \deprecated
84
      * This error return is deprecated as of CUDA 5.0. It is no longer an error
85
      * to call cuProfilerStart() when profiling is already enabled.
86
     |#
87
     :error-profiler-already-started 7
88
 
89
     #|
90
      * \deprecated
91
      * This error return is deprecated as of CUDA 5.0. It is no longer an error
92
      * to call cuProfilerStop() when profiling is already disabled.
93
     |#
94
     :error-profiler-already-stopped 8
95
 
96
     #|
97
      * This indicates that the CUDA driver that the application has loaded is a
98
      * stub library. Applications that run with the stub rather than a real
99
      * driver loaded will result in CUDA API returning this error.
100
     |#
101
     :error-stub-library 34
102
 
103
     #|
104
      * This indicates that requested CUDA device is unavailable at the current
105
      * time. Devices are often unavailable due to use of
106
      * ::CU_COMPUTEMODE_EXCLUSIVE_PROCESS or ::CU_COMPUTEMODE_PROHIBITED.
107
     |#
108
     :error-device-unavailable 46
109
 
110
     #|
111
      * This indicates that no CUDA-capable devices were detected by the installed
112
      * CUDA driver.
113
     |#
114
     :error-no-device 100
115
 
116
     #|
117
      * This indicates that the device ordinal supplied by the user does not
118
      * correspond to a valid CUDA device or that the action requested is
119
      * invalid for the specified device.
120
     |#
121
     :error-invalid-device 101
122
 
123
     #|
124
      * This error indicates that the Grid license is not applied.
125
     |#
126
     :error-device-not-licensed 102
127
 
128
     #|
129
      * This indicates that the device kernel image is invalid. This can also
130
      * indicate an invalid CUDA module.
131
     |#
132
     :error-invalid-image 200
133
 
134
     #|
135
      * This most frequently indicates that there is no context bound to the
136
      * current thread. This can also be returned if the context passed to an
137
      * API call is not a valid handle (such as a context that has had
138
      * ::cuCtxDestroy() invoked on it). This can also be returned if a user
139
      * mixes different API versions (i.e. 3010 context with 3020 API calls).
140
      * See ::cuCtxGetApiVersion() for more details.
141
      * This can also be returned if the green context passed to an API call
142
      * was not converted to a ::CUcontext using ::cuCtxFromGreenCtx API.
143
     |#
144
     :error-invalid-context 201
145
 
146
     #|
147
      * This indicated that the context being supplied as a parameter to the
148
      * API call was already the active context.
149
      * \deprecated
150
      * This error return is deprecated as of CUDA 3.2. It is no longer an
151
      * error to attempt to push the active context via ::cuCtxPushCurrent().
152
     |#
153
     :error-context-already-current 202
154
 
155
     #|
156
      * This indicates that a map or register operation has failed.
157
     |#
158
     :error-map-failed 205
159
 
160
     #|
161
      * This indicates that an unmap or unregister operation has failed.
162
     |#
163
     :error-unmap-failed 206
164
 
165
     #|
166
      * This indicates that the specified array is currently mapped and thus
167
      * cannot be destroyed.
168
     |#
169
     :error-array-is-mapped 207
170
 
171
     #|
172
      * This indicates that the resource is already mapped.
173
     |#
174
     :error-already-mapped 208
175
 
176
     #|
177
      * This indicates that there is no kernel image available that is suitable
178
      * for the device. This can occur when a user specifies code generation
179
      * options for a particular CUDA source file that do not include the
180
      * corresponding device configuration.
181
     |#
182
     :error-no-binary-for-gpu 209
183
 
184
     #|
185
      * This indicates that a resource has already been acquired.
186
     |#
187
     :error-already-acquired 210
188
 
189
     #|
190
      * This indicates that a resource is not mapped.
191
     |#
192
     :error-not-mapped 211
193
 
194
     #|
195
      * This indicates that a mapped resource is not available for access as an
196
      * array.
197
     |#
198
     :error-not-mapped-as-array 212
199
 
200
     #|
201
      * This indicates that a mapped resource is not available for access as a
202
      * pointer.
203
     |#
204
     :error-not-mapped-as-pointer 213
205
 
206
     #|
207
      * This indicates that an uncorrectable ECC error was detected during
208
      * execution.
209
     |#
210
     :error-ecc-uncorrectable 214
211
 
212
     #|
213
      * This indicates that the ::CUlimit passed to the API call is not
214
      * supported by the active device.
215
     |#
216
     :error-unsupported-limit 215
217
 
218
     #|
219
      * This indicates that the ::CUcontext passed to the API call can
220
      * only be bound to a single CPU thread at a time but is already
221
      * bound to a CPU thread.
222
     |#
223
     :error-context-already-in-use 216
224
 
225
     #|
226
      * This indicates that peer access is not supported across the given
227
      * devices.
228
     |#
229
     :error-peer-access-unsupported 217
230
 
231
     #|
232
      * This indicates that a PTX JIT compilation failed.
233
     |#
234
     :error-invalid-ptx 218
235
 
236
     #|
237
      * This indicates an error with OpenGL or DirectX context.
238
     |#
239
     :error-invalid-graphics-context 219
240
 
241
     #|
242
     * This indicates that an uncorrectable NVLink error was detected during the
243
     * execution.
244
     |#
245
     :error-nvlink-uncorrectable 220
246
 
247
     #|
248
     * This indicates that the PTX JIT compiler library was not found.
249
     |#
250
     :error-jit-compiler-not-found 221
251
 
252
     #|
253
      * This indicates that the provided PTX was compiled with an unsupported toolchain.
254
     |#
255
     :error-unsupported-ptx-version 222
256
 
257
     #|
258
      * This indicates that the PTX JIT compilation was disabled.
259
     |#
260
     :error-jit-compilation-disabled 223
261
 
262
     #|
263
      * This indicates that the ::CUexecAffinityType passed to the API call is not
264
      * supported by the active device.
265
     |#
266
     :error-unsupported-exec-affinity 224
267
 
268
     #|
269
      * This indicates that the code to be compiled by the PTX JIT contains
270
      * unsupported call to cudaDeviceSynchronize.
271
     |#
272
     :error-unsupported-devside-sync 225
273
 
274
     #|
275
      * This indicates that the device kernel source is invalid. This includes
276
      * compilation/linker errors encountered in device code or user error.
277
     |#
278
     :error-invalid-source 300
279
 
280
     #|
281
      * This indicates that the file specified was not found.
282
     |#
283
     :error-file-not-found 301
284
 
285
     #|
286
      * This indicates that a link to a shared object failed to resolve.
287
     |#
288
     :error-shared-object-symbol-not-found 302
289
 
290
     #|
291
      * This indicates that initialization of a shared object failed.
292
     |#
293
     :error-shared-object-init-failed 303
294
 
295
     #|
296
      * This indicates that an OS call failed.
297
     |#
298
     :error-operating-system 304
299
 
300
     #|
301
      * This indicates that a resource handle passed to the API call was not
302
      * valid. Resource handles are opaque types like ::CUstream and ::CUevent.
303
     |#
304
     :error-invalid-handle 400
305
 
306
     #|
307
      * This indicates that a resource required by the API call is not in a
308
      * valid state to perform the requested operation.
309
     |#
310
     :error-illegal-state 401
311
 
312
     #|
313
      * This indicates an attempt was made to introspect an object in a way that
314
      * would discard semantically important information. This is either due to
315
      * the object using funtionality newer than the API version used to
316
      * introspect it or omission of optional return arguments.
317
     |#
318
     :error-lossy-query 402
319
 
320
     #|
321
      * This indicates that a named symbol was not found. Examples of symbols
322
      * are global/constant variable names, driver function names, texture names,
323
      * and surface names.
324
     |#
325
     :error-not-found 500
326
 
327
     #|
328
      * This indicates that asynchronous operations issued previously have not
329
      * completed yet. This result is not actually an error, but must be indicated
330
      * differently than ::CUDA_SUCCESS (which indicates completion). Calls that
331
      * may return this value include ::cuEventQuery() and ::cuStreamQuery().
332
     |#
333
     :error-not-ready 600
334
 
335
     #|
336
      * While executing a kernel, the device encountered a
337
      * load or store instruction on an invalid memory address.
338
      * This leaves the process in an inconsistent state and any further CUDA work
339
      * will return the same error. To continue using CUDA, the process must be terminated
340
      * and relaunched.
341
     |#
342
     :error-illegal-address 700
343
 
344
     #|
345
      * This indicates that a launch did not occur because it did not have
346
      * appropriate resources. This error usually indicates that the user has
347
      * attempted to pass too many arguments to the device kernel, or the
348
      * kernel launch specifies too many threads for the kernel's register
349
      * count. Passing arguments of the wrong size (i.e. a 64-bit pointer
350
      * when a 32-bit int is expected) is equivalent to passing too many
351
      * arguments and can also result in this error.
352
     |#
353
     :error-launch-out-of-resources 701
354
 
355
     #|
356
      * This indicates that the device kernel took too long to execute. This can
357
      * only occur if timeouts are enabled - see the device attribute
358
      * ::CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information.
359
      * This leaves the process in an inconsistent state and any further CUDA work
360
      * will return the same error. To continue using CUDA, the process must be terminated
361
      * and relaunched.
362
     |#
363
     :error-launch-timeout 702
364
 
365
     #|
366
      * This error indicates a kernel launch that uses an incompatible texturing
367
      * mode.
368
     |#
369
     :error-launch-incompatible-texturing 703
370
 
371
     #|
372
      * This error indicates that a call to ::cuCtxEnablePeerAccess() is
373
      * trying to re-enable peer access to a context which has already
374
      * had peer access to it enabled.
375
     |#
376
     :error-peer-access-already-enabled 704
377
 
378
     #|
379
      * This error indicates that ::cuCtxDisablePeerAccess() is
380
      * trying to disable peer access which has not been enabled yet
381
      * via ::cuCtxEnablePeerAccess().
382
     |#
383
     :error-peer-access-not-enabled 705
384
 
385
     #|
386
      * This error indicates that the primary context for the specified device
387
      * has already been initialized.
388
     |#
389
     :error-primary-context-active 708
390
 
391
     #|
392
      * This error indicates that the context current to the calling thread
393
      * has been destroyed using ::cuCtxDestroy, or is a primary context which
394
      * has not yet been initialized.
395
     |#
396
     :error-context-is-destroyed 709
397
 
398
     #|
399
      * A device-side assert triggered during kernel execution. The context
400
      * cannot be used anymore, and must be destroyed. All existing device
401
      * memory allocations from this context are invalid and must be
402
      * reconstructed if the program is to continue using CUDA.
403
     |#
404
     :error-assert 710
405
 
406
     #|
407
      * This error indicates that the hardware resources required to enable
408
      * peer access have been exhausted for one or more of the devices
409
      * passed to ::cuCtxEnablePeerAccess().
410
     |#
411
     :error-too-many-peers 711
412
 
413
     #|
414
      * This error indicates that the memory range passed to ::cuMemHostRegister()
415
      * has already been registered.
416
     |#
417
     :error-host-memory-already-registered 712
418
 
419
     #|
420
      * This error indicates that the pointer passed to ::cuMemHostUnregister()
421
      * does not correspond to any currently registered memory region.
422
     |#
423
     :error-host-memory-not-registered 713
424
 
425
     #|
426
      * While executing a kernel, the device encountered a stack error.
427
      * This can be due to stack corruption or exceeding the stack size limit.
428
      * This leaves the process in an inconsistent state and any further CUDA work
429
      * will return the same error. To continue using CUDA, the process must be terminated
430
      * and relaunched.
431
     |#
432
     :error-hardware-stack-error 714
433
 
434
     #|
435
      * While executing a kernel, the device encountered an illegal instruction.
436
      * This leaves the process in an inconsistent state and any further CUDA work
437
      * will return the same error. To continue using CUDA, the process must be terminated
438
      * and relaunched.
439
     |#
440
     :error-illegal-instruction 715
441
 
442
     #|
443
      * While executing a kernel, the device encountered a load or store instruction
444
      * on a memory address which is not aligned.
445
      * This leaves the process in an inconsistent state and any further CUDA work
446
      * will return the same error. To continue using CUDA, the process must be terminated
447
      * and relaunched.
448
     |#
449
     :error-misaligned-address 716
450
 
451
     #|
452
      * While executing a kernel, the device encountered an instruction
453
      * which can only operate on memory locations in certain address spaces
454
      * (global, shared, or local), but was supplied a memory address not
455
      * belonging to an allowed address space.
456
      * This leaves the process in an inconsistent state and any further CUDA work
457
      * will return the same error. To continue using CUDA, the process must be terminated
458
      * and relaunched.
459
     |#
460
     :error-invalid-address-space 717
461
 
462
     #|
463
      * While executing a kernel, the device program counter wrapped its address space.
464
      * This leaves the process in an inconsistent state and any further CUDA work
465
      * will return the same error. To continue using CUDA, the process must be terminated
466
      * and relaunched.
467
     |#
468
     :error-invalid-pc 718
469
 
470
     #|
471
      * An exception occurred on the device while executing a kernel. Common
472
      * causes include dereferencing an invalid device pointer and accessing
473
      * out of bounds shared memory. Less common cases can be system specific - more
474
      * information about these cases can be found in the system specific user guide.
475
      * This leaves the process in an inconsistent state and any further CUDA work
476
      * will return the same error. To continue using CUDA, the process must be terminated
477
      * and relaunched.
478
     |#
479
     :error-launch-failed 719
480
 
481
     #|
482
      * This error indicates that the number of blocks launched per grid for a kernel that was
483
      * launched via either ::cuLaunchCooperativeKernel or ::cuLaunchCooperativeKernelMultiDevice
484
      * exceeds the maximum number of blocks as allowed by ::cuOccupancyMaxActiveBlocksPerMultiprocessor
485
      * or ::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags times the number of multiprocessors
486
      * as specified by the device attribute ::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT.
487
     |#
488
     :error-cooperative-launch-too-large 720
489
 
490
     #|
491
      * This error indicates that the attempted operation is not permitted.
492
     |#
493
     :error-not-permitted 800
494
 
495
     #|
496
      * This error indicates that the attempted operation is not supported
497
      * on the current system or device.
498
     |#
499
     :error-not-supported 801
500
 
501
     #|
502
      * This error indicates that the system is not yet ready to start any CUDA
503
      * work.  To continue using CUDA, verify the system configuration is in a
504
      * valid state and all required driver daemons are actively running.
505
      * More information about this error can be found in the system specific
506
      * user guide.
507
     |#
508
     :error-system-not-ready 802
509
 
510
     #|
511
      * This error indicates that there is a mismatch between the versions of
512
      * the display driver and the CUDA driver. Refer to the compatibility documentation
513
      * for supported versions.
514
     |#
515
     :error-system-driver-mismatch 803
516
 
517
     #|
518
      * This error indicates that the system was upgraded to run with forward compatibility
519
      * but the visible hardware detected by CUDA does not support this configuration.
520
      * Refer to the compatibility documentation for the supported hardware matrix or ensure
521
      * that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES
522
      * environment variable.
523
     |#
524
     :error-compat-not-supported-on-device 804
525
 
526
     #|
527
      * This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server.
528
     |#
529
     :error-mps-connection-failed 805
530
 
531
     #|
532
      * This error indicates that the remote procedural call between the MPS server and the MPS client failed.
533
     |#
534
     :error-mps-rpc-failure 806
535
 
536
     #|
537
      * This error indicates that the MPS server is not ready to accept new MPS client requests.
538
      * This error can be returned when the MPS server is in the process of recovering from a fatal failure.
539
     |#
540
     :error-mps-server-not-ready 807
541
 
542
     #|
543
      * This error indicates that the hardware resources required to create MPS client have been exhausted.
544
     |#
545
     :error-mps-max-clients-reached 808
546
 
547
     #|
548
      * This error indicates the the hardware resources required to support device connections have been exhausted.
549
     |#
550
     :error-mps-max-connections-reached 809
551
 
552
     #|
553
      * This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated and relaunched.
554
     |#
555
     :error-mps-client-terminated 810
556
 
557
     #|
558
      * This error indicates that the module is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it.
559
     |#
560
     :error-cdp-not-supported 811
561
 
562
     #|
563
      * This error indicates that a module contains an unsupported interaction between different versions of CUDA Dynamic Parallelism.
564
     |#
565
     :error-cdp-version-mismatch 812
566
 
567
     #|
568
      * This error indicates that the operation is not permitted when
569
      * the stream is capturing.
570
     |#
571
     :error-stream-capture-unsupported 900
572
 
573
     #|
574
      * This error indicates that the current capture sequence on the stream
575
      * has been invalidated due to a previous error.
576
     |#
577
     :error-stream-capture-invalidated 901
578
 
579
     #|
580
      * This error indicates that the operation would have resulted in a merge
581
      * of two independent capture sequences.
582
     |#
583
     :error-stream-capture-merge 902
584
 
585
     #|
586
      * This error indicates that the capture was not initiated in this stream.
587
     |#
588
     :error-stream-capture-unmatched 903
589
 
590
     #|
591
      * This error indicates that the capture sequence contains a fork that was
592
      * not joined to the primary stream.
593
     |#
594
     :error-stream-capture-unjoined 904
595
 
596
     #|
597
      * This error indicates that a dependency would have been created which
598
      * crosses the capture sequence boundary. Only implicit in-stream ordering
599
      * dependencies are allowed to cross the boundary.
600
     |#
601
     :error-stream-capture-isolation 905
602
 
603
     #|
604
      * This error indicates a disallowed implicit dependency on a current capture
605
      * sequence from cudaStreamLegacy.
606
     |#
607
     :error-stream-capture-implicit 906
608
 
609
     #|
610
      * This error indicates that the operation is not permitted on an event which
611
      * was last recorded in a capturing stream.
612
     |#
613
     :error-captured-event 907
614
 
615
     #|
616
      * A stream capture sequence not initiated with the ::CU_STREAM_CAPTURE_MODE_RELAXED
617
      * argument to ::cuStreamBeginCapture was passed to ::cuStreamEndCapture in a
618
      * different thread.
619
     |#
620
     :error-stream-capture-wrong-thread 908
621
 
622
     #|
623
      * This error indicates that the timeout specified for the wait operation has lapsed.
624
     |#
625
     :error-timeout 909
626
 
627
     #|
628
      * This error indicates that the graph update was not performed because it included 
629
      * changes which violated constraints specific to instantiated graph update.
630
     |#
631
     :error-graph-exec-update-failure 910
632
 
633
     #|
634
      * This indicates that an async error has occurred in a device outside of CUDA.
635
      * If CUDA was waiting for an external device's signal before consuming shared data,
636
      * the external device signaled an error indicating that the data is not valid for
637
      * consumption. This leaves the process in an inconsistent state and any further CUDA
638
      * work will return the same error. To continue using CUDA, the process must be
639
      * terminated and relaunched.
640
     |#
641
     :error-external-device 911
642
 
643
     #|
644
      * Indicates a kernel launch error due to cluster misconfiguration.
645
     |#
646
     :error-invalid-cluster-size 912
647
 
648
     #|
649
      * Indiciates a function handle is not loaded when calling an API that requires
650
      * a loaded function.
651
     |#
652
     :error-function-not-loaded 913
653
 
654
     #|
655
      * This error indicates one or more resources passed in are not valid resource
656
      * types for the operation.
657
     |#
658
     :error-invalid-resource-type 914
659
 
660
     #|
661
      * This error indicates one or more resources are insufficient or non-applicable for
662
      * the operation.
663
     |#
664
     :error-invalid-resource-configuration 915
665
 
666
     #|
667
      * This indicates that an unknown internal error has occurred.
668
     |#
669
     :error-unknown 999)