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
--
http://michael-bien.com/