]> gitweb.factorcode.org Git - factor.git/commitdiff
cuda.devices: factor "context-device cuda-device-properties" into a "context-device...
authorJoe Groff <arcata@gmail.com>
Mon, 17 May 2010 00:15:11 +0000 (17:15 -0700)
committerJoe Groff <arcata@gmail.com>
Mon, 17 May 2010 00:16:27 +0000 (17:16 -0700)
extra/cuda/devices/devices.factor

index fdc86b05f23be2a1799476a656950fe989c0298e..e86c46a9cc6750c5498e2ad4d58f66018cd56770 100644 (file)
@@ -70,6 +70,9 @@ IN: cuda.devices
 : up/i ( x y -- z )
     [ 1 - + ] keep /i ; inline
 
+: context-device-properties ( -- props )
+    context-device cuda-device-properties ; inline
+
 :: (distribute-jobs) ( job-count per-job-shared max-shared-size max-block-size
                        -- grid-size block-size per-block-shared )
     per-job-shared [ max-block-size ] [ max-shared-size swap /i max-block-size min ] if-zero
@@ -81,6 +84,6 @@ IN: cuda.devices
     grid-size block-size per-block-shared ; inline
 
 : distribute-jobs ( job-count per-job-shared -- launcher )
-    context-device cuda-device-properties 
-    [ sharedMemPerBlock>> ] [ maxThreadsDim>> first ] bi
+    context-device-properties
+    [ sharedMemPerBlock>> ] [ maxThreadsPerBlock>> ] bi
     (distribute-jobs) 3<<< ; inline