     cuFuncSetSharedSize cuda-error ; inline
 
 TUPLE: grid
-dim-grid dim-block shared-size stream ;
+    { dim-grid read-only }
+    { dim-block read-only }
+    { shared-size read-only initial: 0 }
+    { stream read-only } ;
 
 : <grid> ( dim-grid dim-block -- grid )
     0 f grid boa ; inline

    grid boa ; inline

<PRIVATE
: block-dim ( block -- x y z )
    dup sequence? [ 3 1 pad-tail first3 ] [ 1 1 ] if ; inline
: grid-dim ( block -- x y )
    dup sequence? [ 2 1 pad-tail first2 ] [ 1 ] if ; inline
PRIVATE>

: load-module ( path -- module )

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

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

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