summaryrefslogtreecommitdiffstats
path: root/cuda/3d/util3d.cu
diff options
context:
space:
mode:
Diffstat (limited to 'cuda/3d/util3d.cu')
-rw-r--r--cuda/3d/util3d.cu35
1 files changed, 35 insertions, 0 deletions
diff --git a/cuda/3d/util3d.cu b/cuda/3d/util3d.cu
index 90aa5ea..41eb9d2 100644
--- a/cuda/3d/util3d.cu
+++ b/cuda/3d/util3d.cu
@@ -386,6 +386,41 @@ bool transferProjectionsToArray(cudaPitchedPtr D_projData, cudaArray* array, con
return true;
}
+bool transferHostProjectionsToArray(const float *projData, cudaArray* array, const SDimensions3D& dims)
+{
+ cudaExtent extentA;
+ extentA.width = dims.iProjU;
+ extentA.height = dims.iProjAngles;
+ extentA.depth = dims.iProjV;
+
+ cudaPitchedPtr ptr;
+ ptr.ptr = (void*)projData; // const cast away
+ ptr.pitch = dims.iProjU*sizeof(float);
+ ptr.xsize = dims.iProjU*sizeof(float);
+ ptr.ysize = dims.iProjAngles;
+
+ cudaMemcpy3DParms p;
+ cudaPos zp = {0, 0, 0};
+ p.srcArray = 0;
+ p.srcPos = zp;
+ p.srcPtr = ptr;
+ p.dstArray = array;
+ p.dstPtr.ptr = 0;
+ p.dstPtr.pitch = 0;
+ p.dstPtr.xsize = 0;
+ p.dstPtr.ysize = 0;
+ p.dstPos = zp;
+ p.extent = extentA;
+ p.kind = cudaMemcpyHostToDevice;
+
+ cudaError err = cudaMemcpy3D(&p);
+ ASTRA_CUDA_ASSERT(err);
+
+ // TODO: check errors
+
+ return true;
+}
+
float dotProduct3D(cudaPitchedPtr data, unsigned int x, unsigned int y,