Login  Register

Re: port of apple's fft

Posted by Michael Bien on Aug 30, 2010; 12:33pm
URL: https://forum.jogamp.org/port-of-apple-s-fft-tp1379040p1388446.html


On 08/30/2010 05:31 AM, notzed [via jogamp] wrote:

Hi Michael,

Yep I had a good look at the AMD one too - but it's only fixed function/1d, the Apple one is somewhat more complete and could form the basis of a decent implementation.
ah ok.

I'm happy for it to end up in the demos - will a patch on the bug tracker suffice?  (i just don't want to deal with a git fork yet).  It's not terribly tidy.
patch is ok. I will try to make sure that you are listed as author in the commit message... should work somehow. Thats the main reason why we usually prefer to just pull form other git forks.

 I'll also try to convert some test code I have into a demo as well (just simple image convolution stuff).
this would be great. We have only one junit test testing the image APIs. I' ll try to convert the demo later to a test if possible.



BTW should put1drangekernel(kernel, 0, G, L);
be the same as
put2drangekernel(kernel, 0, 0, G, 1, L, 1);?
i don't think so. 2d range methods pass 2 to the dimension param of 'clEnqueueNDRangeKernel' and the 1d counterpart passes 1. So both can not give the same result.

basically all calls end up in this method:
    /**
     * Calls {@native clEnqueueNDRangeKernel}.
     */
    public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset,
            PointerBuffer globalWorkSize, PointerBuffer localWorkSize, CLEventList condition, CLEventList events) {

        PointerBuffer conditionIDs = null;
        int conditions = 0;
        if(condition != null) {
            conditionIDs = condition.IDs;
            conditions   = condition.size;
        }

        int ret = cl.clEnqueueNDRangeKernel(
                ID, kernel.ID, workDimension,
                globalWorkOffset,
                globalWorkSize,
                localWorkSize,
                conditions, conditionIDs,
                events==null ? null : events.IDs);

        if(ret != CL_SUCCESS) {
            throw newException(ret, "can not enqueue "+workDimension+"DRangeKernel: " + kernel+ "\n"
                    + " with gwo: " + toStr(globalWorkOffset, workDimension)
                    + " gws: " + toStr(globalWorkSize, workDimension)
                    + " lws: " + toStr(localWorkSize, workDimension)
                    + toStr(condition, events));
        }

        if(events != null) {
            events.createEvent(context);
        }

        return this;
    }
(manpage: http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clEnqueueNDRangeKernel.html)



I spent an inordinate amount of time working out why the 2d fft only ran over a tiny part of the data and it ended up being the putkernel call, the former didn't work the latter did.

maybe i misunderstood something but:
2D Range -> put2DRangeKernel(...)
or:
putNDRangeKernel(kernel, 2, 0, G, L)

best regards,
michael



Cheers,
 Michael


Michael Bien wrote:
  Sure this would be great. If you agree we could add it to the
jocl-demos project.

fyi: The AMD SDK ships also with a FFT example.

regards,
michael

On 08/28/2010 06:53 AM, notzed [via jogamp] wrote:
> Would anyone be interested in apple's fft code ported to jocl?  Or has
> someone already done it?
>
> http://developer.apple.com/mac/library/samplecode/OpenCL_FFT/Introduction/Intro.html
>
> I ported most of it for work in a couple of hours, but if the boss
> wont let me use that version I can always do it again (I want to use
> it for my own code at some point anyway).
>
> It's pretty knarly code but i tried and failed to write my own and
> there's not much else out there that i've been able to find.  Although
> google has become next to useless at finding anything technical
> lately, even more-so with java so it could just be hidden away somewhere.
>
>
>
> ------------------------------------------------------------------------
> View message @
> http://jogamp.762907.n3.nabble.com/port-of-apple-s-fft-tp1379040p1379040.html 
>
> To start a new topic under jogamp, email
> [hidden email]
> To unsubscribe from jogamp, click here
> <http://jogamp.762907.n3.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=762907&code=YmllbmF0b3JAYXJjb3IuZGV8NzYyOTA3fDQxNTEwMDY0OA==>.
>
>


--
- - - -
http://michael-bien.com



View message @ http://jogamp.762907.n3.nabble.com/port-of-apple-s-fft-tp1379040p1386733.html
To start a new topic under jogamp, email [hidden email]
To unsubscribe from jogamp, click here.


-- 
http://michael-bien.com/