summaryrefslogtreecommitdiffstats
path: root/python/astra/astra_c.pyx
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2018-10-23 12:20:18 +0200
committerGitHub <noreply@github.com>2018-10-23 12:20:18 +0200
commiteb97daad97596d54e0da8987ef1c5b1dd91c124f (patch)
treee0f98656f13716b42898c6aefd8abbcc7353d4bc /python/astra/astra_c.pyx
parent6730face204f40c57c3e8fe58ea9749494d669a6 (diff)
parent03ff113ac48f21956247b164a83000b5f6ab311d (diff)
downloadastra-eb97daad97596d54e0da8987ef1c5b1dd91c124f.tar.gz
astra-eb97daad97596d54e0da8987ef1c5b1dd91c124f.tar.bz2
astra-eb97daad97596d54e0da8987ef1c5b1dd91c124f.tar.xz
astra-eb97daad97596d54e0da8987ef1c5b1dd91c124f.zip
Merge pull request #170 from wjp/feature_flags
Add support for checking features at run-time
Diffstat (limited to 'python/astra/astra_c.pyx')
-rw-r--r--python/astra/astra_c.pyx8
1 files changed, 7 insertions, 1 deletions
diff --git a/python/astra/astra_c.pyx b/python/astra/astra_c.pyx
index 65dbf28..69909b5 100644
--- a/python/astra/astra_c.pyx
+++ b/python/astra/astra_c.pyx
@@ -28,7 +28,7 @@
include "config.pxi"
import six
-from .utils import wrap_from_bytes
+from .utils import wrap_from_bytes, wrap_to_bytes
from libcpp.string cimport string
from libcpp.vector cimport vector
@@ -40,6 +40,9 @@ cdef extern from "astra/Globals.h" namespace "astra":
bool cudaEnabled()
bool cudaAvailable()
+cdef extern from "astra/Features.h" namespace "astra":
+ bool hasFeature(string)
+
IF HAVE_CUDA==True:
cdef extern from "astra/cuda/2d/astra.h" namespace "astraCUDA":
bool setGPUIndex(int)
@@ -120,3 +123,6 @@ def info(ids):
if ptr:
s = ptr.getType() + six.b("\t") + ptr.getInfo(i)
six.print_(wrap_from_bytes(s))
+
+def has_feature(feature):
+ return hasFeature(wrap_to_bytes(feature))