diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-09-25 14:00:07 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-09-25 18:34:07 +0200 |
commit | 6730face204f40c57c3e8fe58ea9749494d669a6 (patch) | |
tree | 6ffeb1e86d92c43c91e296da597a269fad28b38f | |
parent | c3137acbebd3159f7dee7d6817e47188991510d4 (diff) | |
download | astra-6730face204f40c57c3e8fe58ea9749494d669a6.tar.gz astra-6730face204f40c57c3e8fe58ea9749494d669a6.tar.bz2 astra-6730face204f40c57c3e8fe58ea9749494d669a6.tar.xz astra-6730face204f40c57c3e8fe58ea9749494d669a6.zip |
Raise exception when setting GPU memory unrealistically small
-rw-r--r-- | python/astra/astra_c.pyx | 2 |
1 files changed, 2 insertions, 0 deletions
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) |