From d85a660f064e8130b27e11c7fd762221c754c315 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 26 Jan 2017 14:57:57 +0100 Subject: Start work on CFloat32Data3DGPU to allow persistent/external GPU memory --- python/astra/pythonutils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'python/astra/pythonutils.py') diff --git a/python/astra/pythonutils.py b/python/astra/pythonutils.py index 3bd3321..27fa8fd 100644 --- a/python/astra/pythonutils.py +++ b/python/astra/pythonutils.py @@ -61,3 +61,21 @@ def geom_size(geom, dim=None): s = s[dim] return s + +class GPULink(object): + """Utility class for astra.data3d.link with a CUDA pointer + + The CUDA pointer ptr must point to an array of floats. + + x is the fastest-changing coordinate, z the slowest-changing. + + pitch is the width in bytes of the memory block. For a contiguous + memory block, pitch is equal to sizeof(float) * x. For a memory block + allocated by cudaMalloc3D, pitch is the pitch as returned by cudaMalloc3D. + """ + def __init__(self, ptr, x, y, z, pitch): + self.ptr = ptr + self.x = x + self.y = y + self.z = z + self.pitch = pitch -- cgit v1.2.3