The EMData class and CUDA
The EMData class can be converted to a CUDA device pointer or alternatively bound to a CUDA texture using single function calls.
Accessing the CUDA device pointer
This can be done with a single function call:
Binding to a CUDA texture
The way in which texture binding occurs is likely to change. What we have right now is a stop gap - the design will evolve as we fully integrate EMAN2 and CUDA. However, the syntax used is not like to substantially change. The main failings in the current implementation is that there is no control over the name of the texture that you bind to, and also that there are only 2 textures (one 2D and one 3D).
Binding to a CUDA texture can be done with a single function call:
Presently there are two global CUDA textures call tex2d (2D) and tex (3D) - the texture with the correct dimensionality will be bound automatically.
CUDA has two filter modes for textures, namely cudaFilterModeLinear and cudaFilterModePoint. The former mode makes use of basic interpolation whereas the latter finds the nearest point.By default cudaFilterModeLinear is used when you call bind_cuda_texture but you can use cudaFilterModePoint by supplying a flag, eg: