 : ?delete-at ( key assoc -- old/key ? )
     2dup delete-at* [ 2nip t ] [ 2drop f ] if ; inline
 
-: cuda-int ( function offset value -- )
-    cuParamSeti cuda-error ; inline
-
-: cuda-float ( function offset value -- )
-    cuParamSetf cuda-error ; inline
+: cuda-param-size ( function n -- )
+    cuParamSetSize cuda-error ; inline
 
 : cuda-vector ( function offset ptr n -- )
     cuParamSetv cuda-error ; inline
-
-: param-size ( function n -- )
-    cuParamSetSize cuda-error ; inline
 
 : launch-function-grid ( function width height -- )
     cuLaunchGrid cuda-error ; inline

        ]
    } 2cleave ;

: cuda-argument-setter ( offset c-type -- offset' quot )
    c-type>cuda-setter
    [ over [ + ] dip ] dip
    '[ swap _ swap _ call ] ;

MACRO: cuda-arguments ( c-types -- quot: ( args... function -- ) )
    [ 0 ] dip [ cuda-argument-setter ] map reverse
    swap '[ _ param-size ] suffix
    '[ _ cleave ] ;

: get-function-ptr ( module string -- function )
    [ CUfunction <c-object> ] 2dip

! 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 words ;
FROM: classes.struct.private => compute-struct-offsets write-struct-slot ;
QUALIFIED-WITH: alien.c-types c
IN: cuda.libraries

