I have asked this question at the Intel Premier site a few years ago (when IPP just came out), and I think it is time to ask it again. In my discussion I mainly refer to the image processing part of IPP though the general idea extends to other part as well.
Today more and more compilers are beginning to support advanced C++ template techniques (a.k.a. template meta-programming, a-la Alexandrescu). IPP is beautifully made, as if tailored, to be wrapped with such C++ wrappers.
The compile-time function dispatch and type constructions fit well with the no-overhead policy of IPP (as opposed to IPL, for example).
Even the IPP function names are semantically identical to template syntax (replace some underscores with commas and angle brackets).
Has anyone considered adding C++ wrappers to IPP[i/s]? This IppImage will be types at compile time and e.g. ippi_copy() will automatically call the correct optimized copy version.
I have seen a first attempt to do this in one of the last issues of C/C++ Users Journal. Though I think some of the details should be done differently, and a more general wrapper is needed, I believe that is the basic way to go.
I have in the past written an Ipl2Ipp wrapper that help interface IPP functions with IPL images without having to calculate all the offsets in-place every time. Especially when IPL images might have ROIs and may not.
However, a more general IppImage would be an even better option since the IPP function names would be grouped under one inline template function where the correct function flavor is chosen automatically by the compiler at compile-time.
This will help maintain the code, as the chance of calling the wrong flavor will be reduced. Calling an unsupported function will result in a compile-time error instead of a run-time error now, or worst, no run-time error.
A change to the image pixel depth at the instantiation point would require a recompile without having to go to all the code and manually change the IPP functions.
The difficulty in doing this external to the Intel library, is that this library will have to change and be extended for every new version of IPP. The many functions (over 1000) must be grouped and tested in the new header files.
Your comments, please,