Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portable interpolated look-up table using texture memory #26

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

rcalland
Copy link

Lookup class hemi::Table3D<T> that creates an interface to a look-up table structure, using texture memory on GPU. Trilinear interpolation is implemented on CPU, and agrees to 5/6 decimal places when compared to the texture memory results.

The user calls readOnlyDevicePtr() to return a pointer to the struct object hemi::table3<T> that can be passed to the kernel. The similarity of Table3D<T> and table3<t> bothers me slightly so a better naming convention would be appreciated. The interpolation can then be performed by lookup_struct->lookup(x, y, z) both in a CUDA kernel and in host code. The device code is ~20 times faster when performing millions of interpolations.

The current implementation is only for 3D LUTs, but it is straightforward to create 1D and 2D versions. There are also other limitations such as read-only access, but this could be improved on with surface objects. Also, the CPU implementation has no out-of-bounds array checking, for speed reasons. This could be changed.

See the two example programs added in /hemi/examples/simple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant