diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-11-09 20:57:31 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2018-01-09 14:23:54 +0100 |
commit | 0ad6cb01b9176e99c3e4bb5643ac6a5dd477aad6 (patch) | |
tree | 69b27fa6406cf318d785c827e1fd05b786da2876 /src/Globals.cpp | |
parent | de27e439a0c59fade175fba4e0b4a1e0c84b933d (diff) | |
download | astra-0ad6cb01b9176e99c3e4bb5643ac6a5dd477aad6.tar.gz astra-0ad6cb01b9176e99c3e4bb5643ac6a5dd477aad6.tar.bz2 astra-0ad6cb01b9176e99c3e4bb5643ac6a5dd477aad6.tar.xz astra-0ad6cb01b9176e99c3e4bb5643ac6a5dd477aad6.zip |
Check for CUDA support at run-time in use_cuda()
Diffstat (limited to 'src/Globals.cpp')
-rw-r--r-- | src/Globals.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Globals.cpp b/src/Globals.cpp index 0edb397..bbe0c2f 100644 --- a/src/Globals.cpp +++ b/src/Globals.cpp @@ -26,9 +26,19 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>. */ #include "astra/Globals.h" +#include "cuda/2d/astra.h" + +namespace astra { + +bool running_in_matlab=false; + +_AstraExport bool cudaAvailable() { +#ifdef ASTRA_CUDA + return astraCUDA::availableGPUMemory() > 0; +#else + return false; +#endif +} -namespace astra{ - bool running_in_matlab=false; } -// nothing to see here :) |