Skip to content

portable interpolated look-up table using texture memory#26

Open
rcalland wants to merge 12 commits intoharrism:masterfrom
rcalland:table
Open

portable interpolated look-up table using texture memory#26
rcalland wants to merge 12 commits intoharrism:masterfrom
rcalland:table

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