]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/cuda/contexts/contexts.factor
Move <ref>, deref and little-endian? from alien.c-types to alien.data, remove <c...
[factor.git] / extra / cuda / contexts / contexts.factor
index 714eaab94c60e7d8ba36f30e4db30f85054e2b9e..5218f7b23eed1f6665cdfdce0b6a88559fe20fa3 100644 (file)
@@ -9,14 +9,14 @@ IN: cuda.contexts
 
 : create-context ( device flags -- context )
     swap
-    [ CUcontext <c-object> ] 2dip
-    [ cuCtxCreate cuda-error ] 3keep 2drop void* deref ; inline
+    [ { CUcontext } ] 2dip
+    '[ _ _ cuCtxCreate cuda-error ] with-out-parameters ; inline
 
 : sync-context ( -- )
     cuCtxSynchronize cuda-error ; inline
 
 : context-device ( -- n )
-    CUdevice <c-object> [ cuCtxGetDevice cuda-error ] keep int deref ; inline
+    { CUdevice } [ cuCtxGetDevice cuda-error ] with-out-parameters ; inline
 
 : destroy-context ( context -- ) cuCtxDestroy cuda-error ; inline