summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2017-10-17 21:06:50 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-11-01 15:53:26 +0100
commit355ee14464f76f7a506143ef44a9b5a5319c4951 (patch)
tree9ffafcedca289e8c7828768db0d1c9c273db3df3
parentfa92fc50355d0cbc185098ef6bcf78fa9dc65623 (diff)
downloadastra-355ee14464f76f7a506143ef44a9b5a5319c4951.tar.gz
astra-355ee14464f76f7a506143ef44a9b5a5319c4951.tar.bz2
astra-355ee14464f76f7a506143ef44a9b5a5319c4951.tar.xz
astra-355ee14464f76f7a506143ef44a9b5a5319c4951.zip
Move set_gpu_index, get_gpu_info from astra.astra to astra
-rw-r--r--python/astra/__init__.py3
-rw-r--r--samples/python/s020_3d_multiGPU.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/python/astra/__init__.py b/python/astra/__init__.py
index b73fff5..d5aac44 100644
--- a/python/astra/__init__.py
+++ b/python/astra/__init__.py
@@ -27,6 +27,7 @@ from . import matlab as m
from .creators import astra_dict,create_vol_geom, create_proj_geom, create_backprojection, create_sino, create_reconstruction, create_projector,create_sino3d_gpu, create_backprojection3d_gpu
from .functions import data_op, add_noise_to_sino, clear, move_vol_geom
from .extrautils import clipCircle
+from .astra import set_gpu_index, get_gpu_info
from . import data2d
from . import astra
from . import data3d
@@ -45,4 +46,4 @@ import os
if 'ASTRA_GPU_INDEX' in os.environ:
L = [ int(x) for x in os.environ['ASTRA_GPU_INDEX'].split(',') ]
- astra.set_gpu_index(L)
+ set_gpu_index(L)
diff --git a/samples/python/s020_3d_multiGPU.py b/samples/python/s020_3d_multiGPU.py
index 11a1e11..e872870 100644
--- a/samples/python/s020_3d_multiGPU.py
+++ b/samples/python/s020_3d_multiGPU.py
@@ -28,11 +28,11 @@ import numpy as np
# Set up multi-GPU usage.
# This only works for 3D GPU forward projection and back projection.
-astra.astra.set_gpu_index([0,1])
+astra.set_gpu_index([0,1])
# Optionally, you can also restrict the amount of GPU memory ASTRA will use.
# The line commented below sets this to 1GB.
-#astra.astra.set_gpu_index([0,1], memory=1024*1024*1024)
+#astra.set_gpu_index([0,1], memory=1024*1024*1024)
vol_geom = astra.create_vol_geom(1024, 1024, 1024)