]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/cuda/cuda.factor
factor: trim using lists
[factor.git] / extra / cuda / cuda.factor
index 566622eb029e0dee065983dcbbd0c2b45e7c800c..4278ab938b8da5b32b2339bd5b30b844568cd260 100644 (file)
@@ -1,23 +1,16 @@
 ! Copyright (C) 2010 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien alien.data alien.parser alien.strings
-alien.syntax arrays assocs byte-arrays classes.struct
-combinators continuations cuda.ffi
-destructors fry init io io.backend io.encodings.string
-io.encodings.utf8 kernel lexer locals macros math math.parser
-namespaces opengl.gl.extensions parser prettyprint quotations
-sequences words ;
+USING: alien.c-types alien.data cuda.ffi kernel ;
 QUALIFIED-WITH: alien.c-types c
 IN: cuda
 
-TUPLE: cuda-error code ;
+ERROR: cuda-error-state code ;
 
 : cuda-error ( code -- )
-    dup CUDA_SUCCESS = [ drop ] [ \ cuda-error boa throw ] if ;
+    dup CUDA_SUCCESS = [ drop ] [ cuda-error-state ] if ;
 
 : cuda-version ( -- n )
-    c:int <c-object> [ cuDriverGetVersion cuda-error ] keep c:int c:deref ;
+    { c:int } [ cuDriverGetVersion cuda-error ] with-out-parameters ;
 
 : init-cuda ( -- )
     0 cuInit cuda-error ; inline
-