Java and IPP

Java and IPP

A while ago (around v1.0 I think), there was talk of a Java interface to IPP (on the website at least). To many this may sound ridiculous, but I have been using IPP in Java with great success via JNI wrappers. In fact I have been developing a general purpose image analysis package, based on IPP, in Java, that is both quick and portable. I put some guff on the wrapping part ofthis here:

http://www.cssip.uq.edu.au/staff/bamford/JIPP/index.htm

Only problem is that writing the wrapper functions is non-trivial (I wrote a dedicated parser for the IPP *.h files, but it isn't robust).

Are there any plans at Intel to do something similar (but properly!), or has someone thought better of it since the early days?

Pascal.

P.S. Do multiple posts increase your chances of getting the book?!!

15 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Pascal,

what particular Java do you want?

Regards,
Vladimir

I may have got the meaning of your question wrong, but it shouldn't matter which version of Java... 1.4.0 introduced the nio package which is handy for 'exposing' IPP-allocated memory to Java (for copying into BufferedImages etc. - see the website in original post), but other than that it is a JNI task which as far as I know has been pretty stable...

Pascal (fellow Scorpions fan)

Pascal, How many IPP functions are you going to be using and in which IPP functional domains? e.g. image, audio etc.

The overhead of JNI is not trivial, as you know. Since IPPs are primitives, a lot of cycles gained in optimized performance is lost because of the JNI overhead of calling an IPP function.

I suggest you to try this: group multiple calls to primitive functions into one JNI call if it is possible for your usage scenario.This will help reduce the JNI overhead if you can pack as many native calls as possible into one JNI call. Try to use managed memory instead of unmanaged memory where possible. Java env lets you access managed mem from unmanaged (or native) code.

If you are interested in .NET, the C# wrappers (using P/Invoke) for IPP functionsis available as part of ourIPP 4.0 release, but we don't have Java (JNI) wrappers yet. C# wrappers are available on premier.intel.com.

Actually, I mean whichimplementation of Java you are interested in? You know, there are several ones.

Vladimir

Good point. I use IPP almost exclusively for image processing on largeish images (at least 1k by 1k). I've noticed that the JNI overhead is negligible compared to the actual image processing for this and thus quite happily call individual functions rather than grouping them together.

Hello Pascal,

You've done really fantastic work !

Regards,

Andrew

PS. Are you planning on doing the same for 1D part of IPP (if not maybe I will)

Thanks, Andrew. I have wrapped the functions ipps.h, but I haven't posted them on the website. I can send them to you, if you like.

As with the other wrappers, they contain errors due to my imperfect parser. Testing, or at least eyeballing, each function is proving to be too much work for me.

My motivation for the original post to this forum was to encourage others (but preferably Intel!) to do this work in a more organised way than I can. If you have plans for a better 'go' at this then please keep me/us informed!!!

If anyone else is interested, I and the people that have contacted me like the idea of Java IPP wrappers because:

1. They speed development as only Java codeneeds to be written to access the fast IPP routines (i.e. no mixed C/JNI and Java)

2. People use IPP to speed up slow operations, e.g. image processing on large images, where the JNI overhead is negligable. This makes itworthwhile to wrap each individual function rather than lumping together several in a single JNI call.

Hi Pascal,

Yes, I totally agree with your reasons and motivation. Some time ago, I was really frustrated with a performance of image processing in Java environment, but I still like a "beauty of Java", especially for GUIs. That's why I really appreciate your integration of "beauty and beast (aka IPP)"and would be very interested in getting access to your java wrapper for 1D IPPS library. Sorry to say, but currently I don't have a plan for making it "a better way" as my major motivation is to createas soon as possible "a convenient and flexible R&D environment"for video processing algorithms as motion estimation, rescaling, deinterlacing, ...

Best regards,

Andrew

Hi,

thanks very much for your effort on this. Yes, we also thinking in this direction. I believe we will add Java wrappers in the future IPP releases.

Regards,
Vladimir

It will be JNI interface (jdk 1.5) provided in IPP 5.0 for all IPP domains. please expect overhead of the JNI though

Hi,

Thanks for this java information.

Thanks,
smartknight

Could you advise on a date ?.

Regards
/rk

Hi,

we can't say about exact date of the next release but it planned to be somewhere at Q1 of this year.

Regards,
Vladimir

Quoting - pascal_bamford

Hellow Andrew,
I am jackson. I had installed ipp for linux and got the java sample code also but i am unable to run the java code.I need a procedure how to run the java code in linux environment.

Thanks, Andrew. I have wrapped the functions ipps.h, but I haven't posted them on the website. I can send them to you, if you like.

As with the other wrappers, they contain errors due to my imperfect parser. Testing, or at least eyeballing, each function is proving to be too much work for me.

My motivation for the original post to this forum was to encourage others (but preferably Intel!) to do this work in a more organised way than I can. If you have plans for a better 'go' at this then please keep me/us informed!!!

If anyone else is interested, I and the people that have contacted me like the idea of Java IPP wrappers because:

1. They speed development as only Java code needs to be written to access the fast IPP routines (i.e. no mixed C/JNI and Java)

2. People use IPP to speed up slow operations, e.g. image processing on large images, where the JNI overhead is negligable. This makes it worthwhile to wrap each individual function rather than lumping together several in a single JNI call.

Leave a Comment

Please sign in to add a comment. Not a member? Join today