com.nativelibs4java.opencl.util.fft.FloatDFTProgram Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javacl Show documentation
Show all versions of javacl Show documentation
JavaCL is an Object-Oriented API that makes the C OpenCL API available to Java in a very natural way.
It hides away the complexity of cross-platform C bindings, has a clean OO design (with generics, Java enums, NIO buffers, fully typed exceptions...), provides high-level features (OpenGL-interop, array reductions) and comes with samples and demos.
For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL.
package com.nativelibs4java.opencl.util.fft;
import com.nativelibs4java.opencl.CLAbstractUserProgram;
import com.nativelibs4java.opencl.CLBuffer;
import com.nativelibs4java.opencl.CLBuildException;
import com.nativelibs4java.opencl.CLContext;
import com.nativelibs4java.opencl.CLEvent;
import com.nativelibs4java.opencl.CLKernel;
import com.nativelibs4java.opencl.CLProgram;
import com.nativelibs4java.opencl.CLQueue;
import java.io.IOException;
/// Wrapper around the OpenCL program FloatDFTProgram
public class FloatDFTProgram extends CLAbstractUserProgram {
public FloatDFTProgram(CLContext context) throws IOException {
super(context, readRawSourceForClass(FloatDFTProgram.class));
}
public FloatDFTProgram(CLProgram program) throws IOException {
super(program, readRawSourceForClass(FloatDFTProgram.class));
}
CLKernel dft_kernel;
public synchronized CLEvent dft(CLQueue commandQueue, CLBuffer in, CLBuffer out, int length, int sign, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
if (dft_kernel == null)
dft_kernel = createKernel("dft");
dft_kernel.setArgs(in, out, length, sign);
return dft_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
}
}