summaryrefslogtreecommitdiffstats
path: root/cuda/3d/mem3d.cu
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-03-01 14:47:43 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-03-01 14:47:43 +0100
commit0db21a84dd3cb0f6a78bd462a4a60a4b4a3c6fae (patch)
treea833d4787504e8612282a82c60d3984be51bdffe /cuda/3d/mem3d.cu
parentda11f9e7c7559eb01cc422ac55c9f7a1cd4bb803 (diff)
parentb74e64aef7845666d27cbf7e876a6a360eefed7f (diff)
downloadastra-0db21a84dd3cb0f6a78bd462a4a60a4b4a3c6fae.tar.gz
astra-0db21a84dd3cb0f6a78bd462a4a60a4b4a3c6fae.tar.bz2
astra-0db21a84dd3cb0f6a78bd462a4a60a4b4a3c6fae.tar.xz
astra-0db21a84dd3cb0f6a78bd462a4a60a4b4a3c6fae.zip
Merge branch 'master' into indexmanager
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 6d81dc0..0320117 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;