             [ grid-dim launch-function-grid ]
             [ launch-function ] if*
         ]
-    } 2cleave ;
+    } 2cleave ; inline
 
 <PRIVATE
 : make-param-buffer ( function size -- buffer size )

: define-cuda-function ( word module-name function-name arguments -- )
    [ '[ _ _ _ cuda-invoke ] ]
    [ 2nip \ grid suffix c:void function-effect ]
    3bi define-declared ;

: define-cuda-global ( word module-name symbol-name -- )
    '[ _ _ cuda-global ] (( -- device-ptr )) define-declared ;

TUPLE: cuda-library name abi path handle ;
ERROR: bad-cuda-abi abi ;

    grid boa ; inline

<PRIVATE
GENERIC: block-dim ( block-size -- x y z ) foldable
M: integer block-dim 1 1 ; inline
M: sequence block-dim
    dup length {
        { 0 [ drop 1 1 1 ] }
        { 1 [ first 1 1 ] }
        { 2 [ first2 1 ] }
        [ drop first3 ]
    } case ; inline

GENERIC: grid-dim ( grid-size -- x y ) foldable
M: integer grid-dim 1 ; inline
M: sequence grid-dim
    dup length {
        { 0 [ drop 1 1 ] }
        { 1 [ first 1 ] }
        [ drop first2 ]
    } case ; inline
PRIVATE>

: load-module ( path -- module )
