cuda.devices: have distribute-jobs construct a launcher with the calculated grid-dim, block-dim, and shared-size
parent
5a980b58cb
commit
6d41ea32f5
|
@ -2,8 +2,8 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors alien.c-types alien.data alien.strings arrays
|
USING: accessors alien.c-types alien.data alien.strings arrays
|
||||||
assocs byte-arrays classes.struct combinators cuda cuda.ffi
|
assocs byte-arrays classes.struct combinators cuda cuda.ffi
|
||||||
cuda.utils fry io io.encodings.utf8 kernel locals math
|
cuda.syntax cuda.utils fry io io.encodings.utf8 kernel locals
|
||||||
math.order math.parser namespaces prettyprint sequences ;
|
math math.order math.parser namespaces prettyprint sequences ;
|
||||||
IN: cuda.devices
|
IN: cuda.devices
|
||||||
|
|
||||||
: #cuda-devices ( -- n )
|
: #cuda-devices ( -- n )
|
||||||
|
@ -80,7 +80,7 @@ IN: cuda.devices
|
||||||
|
|
||||||
grid-size block-size per-block-shared ; inline
|
grid-size block-size per-block-shared ; inline
|
||||||
|
|
||||||
: distribute-jobs ( job-count per-job-shared -- grid-size block-size per-block-shared )
|
: distribute-jobs ( job-count per-job-shared -- launcher )
|
||||||
cuda-device get cuda-device-properties
|
cuda-device get cuda-device-properties
|
||||||
[ sharedMemPerBlock>> ] [ maxThreadsDim>> ] bi
|
[ sharedMemPerBlock>> ] [ maxThreadsDim>> ] bi
|
||||||
(distribute-jobs) ; inline
|
(distribute-jobs) 3<<< ; inline
|
||||||
|
|
Loading…
Reference in New Issue