From 6730face204f40c57c3e8fe58ea9749494d669a6 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 25 Sep 2018 14:00:07 +0200 Subject: Raise exception when setting GPU memory unrealistically small --- python/astra/astra_c.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/astra/astra_c.pyx b/python/astra/astra_c.pyx index 1d3fad7..65dbf28 100644 --- a/python/astra/astra_c.pyx +++ b/python/astra/astra_c.pyx @@ -84,6 +84,8 @@ IF HAVE_CUDA==True: if use_cuda()==True: if not isinstance(idx, collections.Iterable) or isinstance(idx, six.string_types + (six.text_type,six.binary_type)): idx = (idx,) + if memory < 1024*1024: + raise ValueError("Setting GPU memory lower than 1MB is not supported.") params.memory = memory params.GPUIndices = idx setGlobalGPUParams(params) -- cgit v1.2.3