]> gitweb.factorcode.org Git - factor.git/commitdiff
cuda: use arg names in stack effect.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Apr 2016 20:11:32 +0000 (13:11 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 6 Apr 2016 20:11:32 +0000 (13:11 -0700)
extra/cuda/libraries/libraries.factor
extra/cuda/syntax/syntax.factor

index f899d4430d303af4a3b6e68e7cd52a78888dd1c1..21eef3d46e7724b962b08d32b9758070288e5c41 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2010 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.data alien.parser arrays assocs
-byte-arrays classes.struct combinators combinators.short-circuit
-cuda cuda.ffi fry generalizations io.backend kernel macros math
-namespaces sequences variants words ;
-FROM: classes.struct.private => compute-struct-offsets write-struct-slot ;
+byte-arrays classes.struct classes.struct.private combinators
+combinators.short-circuit cuda cuda.ffi fry generalizations
+io.backend kernel locals macros math namespaces sequences
+variants words ;
 QUALIFIED-WITH: alien.c-types c
 IN: cuda.libraries
 
@@ -177,10 +177,11 @@ MACRO: cuda-invoke ( module-name function-name arguments -- quot )
 : cuda-global ( module-name symbol-name -- device-ptr )
     cuda-global* drop ; inline
 
-: define-cuda-function ( word module-name function-name arguments -- )
-    [ '[ _ _ _ cuda-invoke ] ]
-    [ 2nip \ grid suffix c:void function-effect ]
-    3bi define-inline ;
+:: define-cuda-function ( word module-name function-name types names -- )
+    word
+    [ module-name function-name types cuda-invoke ]
+    names "grid" suffix c:void function-effect
+    define-inline ;
 
 : define-cuda-global ( word module-name symbol-name -- )
     '[ _ _ cuda-global ] ( -- device-ptr ) define-inline ;
index 3b1cad591f31be3ba97d5943bea0f7cd585d58d7..baf7b18ec80a94ad47395daa1844d96c1109a6e2 100644 (file)
@@ -11,7 +11,7 @@ SYNTAX: CUDA-LIBRARY:
 
 SYNTAX: CUDA-FUNCTION:
     scan-token [ create-word-in current-cuda-library get ] keep
-    scan-c-args drop define-cuda-function ;
+    scan-c-args define-cuda-function ;
 
 SYNTAX: CUDA-GLOBAL:
     scan-token [ create-word-in current-cuda-library get ] keep