vigra
vigra copied to clipboard
OpenCL interoperability: types, arithmetic, conversion and utility
This is a feature-request / place-to-capture a design document.
Summary
It would be nice to have support for OpenCL interoperation with Vigra MultiArrays.
Details
This can be at various levels:
- support for OpenCL [vector] datatypes (cl_float, cl_float3, cl_char4, etc...), including various MultiArray accessors.
- utility functions for copying between cl_mem objects and OpenCL MultiArrays holding OpenCL types.
- multi_math operators emulating OpenCL's operators for MultiArrays holding these types (+, -, ..., length(), dot(),...).
- (the pie-in-the-sky feature) a MultiArray-like class that has its data memory in cl_mem, and transparently does all of its operations on its members using special OpenCL kernels that mimic the CPU-operation counterparts.
Feedback
Comment on this issue with suggestions, feature-requests, complaints, etc...
Status
I have started working on support for the datatypes, so far have NumericTraits and some Accessors started. I'm totally open to changing the names, or any suggestions. My start is available here: https://github.com/tesch1/vigra/blob/feature-opencl/include/vigra/multi_opencl.hxx feel free to add/subract/pull-request with fixes/features.
For example, so far, the accessor for the .z component of a cl_float3
is declared as:
struct cl_double3Accessor_z;
and the write accessor is struct double3WriteAccessor_z
Please conduct this development in a branch of its own (e.g. 'feature-opencl').