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

KindCoveredAll%
expression033 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; alien.lisp --- CUDA Alien Functions
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :cuda)
7
 
8
 (macrolet ((defcu (name &rest args)
9
              `(defar ,name cu-result ,@args)))
10
   (defcu ("cuInit" cu-init) (flags unsigned-int))
11
   (defcu ("cuDeviceGet" cu-device-get) (device (* cu-device)) (ordinal int))
12
   (defcu ("cuDeviceGetCount" cu-device-get-count) (count (* int)))
13
   (defcu ("cuDeviceComputeCapability" cu-device-compute-capability) (major (* int)) (minor (* int)) (dev cu-device))
14
   (defcu ("cuDeviceGetName" cu-device-get-name) (name c-string) (len int) (dev cu-device))
15
   (defcu ("cuCtxCreate_v2" cu-ctx-create) (pctx (* cu-context)) (flags unsigned-int) (dev cu-device))
16
   (defcu ("cuCtxDestroy_v2" cu-ctx-destroy) (ctx cu-context))
17
   (defcu ("cuCtxSynchronize" cu-ctx-synchronize))
18
   (defcu ("cuDeviceTotalMem" cu-device-total-mem) (bytes (* size-t)) (dev int))
19
   (defcu ("cuMemAlloc_v2" cu-mem-alloc) (dptr (* cu-device-ptr)) (bytesize size-t))
20
   (defcu ("cuMemFree_v2" cu-mem-free) (dptr cu-device-ptr))
21
   (defcu ("cuMemHostRegister" cu-mem-host-register) (p (* t)) (byte-size size-t) (flags unsigned-int))
22
   (defcu ("cuMemHostUnregister" cu-mem-host-unregister) (p (* t)))
23
   (defcu ("cuMemcpyHtoD_v2" cu-memcpy-host-to-device) (dst cu-device-ptr) (src-host (* t)) (byte-count size-t))
24
   (defcu ("cuMemcpyHtoDAsync_v2" cu-memcpy-host-to-device-async) 
25
       (dst cu-device-ptr) (src-ptr (* t)) (byte-count size-t) (hstream cu-stream))
26
   (defcu ("cuMemcpyDtoH_v2" cu-memcpy-device-to-host) 
27
       (dst-host (* t)) (src-device cu-device-ptr) (byte-count size-t))
28
   (defcu ("cuMemcpyDtoHAsync_v2" cu-memcpy-device-to-host-async) 
29
       (dst-host (* t)) (src-device cu-device-ptr) (byte-count size-t) (hstream cu-stream))
30
   ;; requires fp traps disabled?
31
   (defcu ("cuModuleLoad" cu-module-load) (module (* cu-module)) (fname c-string))
32
   (defcu ("cuModuleUnload" cu-module-unload) (module cu-module))
33
   (defcu ("cuModuleGetFunction" cu-module-get-function) (hfunc (* cu-function)) (hmod cu-module) (name c-string))
34
   (defcu ("cuModuleGetGlobal_v2" cu-module-get-global)
35
       (dptr (* cu-device-ptr)) (bytes (* size-t)) (hmod cu-module) (name c-string))
36
   (defcu ("cuLaunchKernel" cu-launch-kernel) (f cu-function) 
37
     (grid-dim-x unsigned-int) (grid-dim-y unsigned-int) (grid-dim-z unsigned-int)
38
     (block-dim-x unsigned-int) (block-dim-y unsigned-int) (block-dim-z unsigned-int)
39
     (shared-mem-bytes unsigned-int) (hstream cu-stream) (kernel-params (* (* t))) (extra (* (* t))))
40
   (defcu ("cuEventCreate" cu-event-create) (phevent (* cu-event)) (flags unsigned-int))
41
   (defcu ("cuEventDestroy_v2" cu-event-destroy) (h-event cu-event))
42
   (defcu ("cuEventElapsedTime" cu-event-elapsed-time) (pmillis (* float)) (hstart cu-event) (hend cu-event))
43
   (defcu ("cuEventRecord" cu-event-record) (hevent cu-event) (hstream cu-stream))
44
   (defcu ("cuEventSynchronize" cu-event-synchronize) (hevent cu-event))
45
   (defcu ("cuStreamCreate" cu-stream-create) (phstream (* cu-stream)) (flags unsigned-int))
46
   (defcu ("cuStreamDestroy" cu-stream-destroy) (hstream cu-stream))
47
   (defcu ("cuStreamQuery" cu-stream-query) (hstream cu-stream))
48
   (defcu ("cuStreamSynchronize" cu-stream-synchronize) (hstream cu-stream))
49
   (defcu ("cuStreamWaitEvent" cu-stream-wait-event) (hstream cu-stream) (hevent cu-event) (flags unsigned-int)))