summaryrefslogtreecommitdiffstats
path: root/cuda/3d/mem3d.cu
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-04-18 11:51:32 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-04-18 11:51:32 +0200
commitc366f2b07ce16c4ccdafc7cc4199fdac2d3ffef2 (patch)
treee9dc99f16607021d60ddb24c63ba7438e41a235d /cuda/3d/mem3d.cu
parentb8ee38bdada2067f4351b27d841e68580bcbff8e (diff)
parent547def0ea6e3eab07b7e4c48cee6d6a81f6155e1 (diff)
downloadastra-c366f2b07ce16c4ccdafc7cc4199fdac2d3ffef2.tar.gz
astra-c366f2b07ce16c4ccdafc7cc4199fdac2d3ffef2.tar.bz2
astra-c366f2b07ce16c4ccdafc7cc4199fdac2d3ffef2.tar.xz
astra-c366f2b07ce16c4ccdafc7cc4199fdac2d3ffef2.zip
Merge branch 'master' into aniso
Diffstat (limited to 'cuda/3d/mem3d.cu')
-rw-r--r--cuda/3d/mem3d.cu19
1 files changed, 19 insertions, 0 deletions
diff --git a/cuda/3d/mem3d.cu b/cuda/3d/mem3d.cu
index d09c203..9a239da 100644
--- a/cuda/3d/mem3d.cu
+++ b/cuda/3d/mem3d.cu
@@ -62,6 +62,25 @@ size_t availableGPUMemory()
return free;
}
+int maxBlockDimension()
+{
+ int dev;
+ cudaError_t err = cudaGetDevice(&dev);
+ if (err != cudaSuccess) {
+ ASTRA_WARN("Error querying device");
+ return 0;
+ }
+
+ cudaDeviceProp props;
+ err = cudaGetDeviceProperties(&props, dev);
+ if (err != cudaSuccess) {
+ ASTRA_WARN("Error querying device %d properties", dev);
+ return 0;
+ }
+
+ return std::min(props.maxTexture3D[0], std::min(props.maxTexture3D[1], props.maxTexture3D[2]));
+}
+
MemHandle3D allocateGPUMemory(unsigned int x, unsigned int y, unsigned int z, Mem3DZeroMode zero)
{
SMemHandle3D_internal hnd;