From e286a8daef6f382cac008ff568fadc2700508d3d Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 16 May 2010 17:15:11 -0700 Subject: [PATCH] cuda.devices: factor "context-device cuda-device-properties" into a "context-device-properties" word --- extra/cuda/devices/devices.factor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extra/cuda/devices/devices.factor b/extra/cuda/devices/devices.factor index fdc86b05f2..e86c46a9cc 100644 --- a/extra/cuda/devices/devices.factor +++ b/extra/cuda/devices/devices.factor @@ -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