]> gitweb.factorcode.org Git - factor.git/blob - extra/cuda/cuda.factor
factor: trim using lists
[factor.git] / extra / cuda / cuda.factor
1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.data cuda.ffi kernel ;
4 QUALIFIED-WITH: alien.c-types c
5 IN: cuda
6
7 ERROR: cuda-error-state code ;
8
9 : cuda-error ( code -- )
10     dup CUDA_SUCCESS = [ drop ] [ cuda-error-state ] if ;
11
12 : cuda-version ( -- n )
13     { c:int } [ cuDriverGetVersion cuda-error ] with-out-parameters ;
14
15 : init-cuda ( -- )
16     0 cuInit cuda-error ; inline