From afdced018383dc020a72e3ba6c92cf72f63c9bf5 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 14 May 2010 15:17:26 -0700 Subject: [PATCH] cuda: in with-cuda-context, sync context when cleaning up so that destroying context doesn't fail due to asynchronous errors --- extra/cuda/cuda.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/cuda/cuda.factor b/extra/cuda/cuda.factor index 667b3726c2..3b472854b3 100644 --- a/extra/cuda/cuda.factor +++ b/extra/cuda/cuda.factor @@ -26,7 +26,7 @@ dim-grid dim-block shared-size stream ; H{ } clone cuda-functions set [ create-context ] dip [ '[ _ @ ] ] - [ drop '[ _ destroy-context ] ] 2bi + [ drop '[ [ sync-context ] ignore-errors _ destroy-context ] ] 2bi [ ] cleanup ; inline : with-cuda-program ( flags device quot -- )