All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nativelibs4java.opencl.util.fft.FloatFFTProgram Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.0.0-RC4
Show newest version
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 FloatFFTProgram
public class FloatFFTProgram extends CLAbstractUserProgram {
	public FloatFFTProgram(CLContext context) throws IOException {
		super(context, readRawSourceForClass(FloatFFTProgram.class));
	}
	public FloatFFTProgram(CLProgram program) throws IOException {
		super(program, readRawSourceForClass(FloatFFTProgram.class));
	}
	CLKernel cooleyTukeyFFTCopy_kernel;
	public synchronized CLEvent cooleyTukeyFFTCopy(CLQueue commandQueue, CLBuffer X, CLBuffer Y, int N, CLBuffer offsetsX, float factor, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (cooleyTukeyFFTCopy_kernel == null) 
			cooleyTukeyFFTCopy_kernel = createKernel("cooleyTukeyFFTCopy");
		cooleyTukeyFFTCopy_kernel.setArgs(X, Y, N, offsetsX, factor);
		return cooleyTukeyFFTCopy_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel cooleyTukeyFFTTwiddleFactors_kernel;
	public synchronized CLEvent cooleyTukeyFFTTwiddleFactors(CLQueue commandQueue, int N, CLBuffer twiddleFactors, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (cooleyTukeyFFTTwiddleFactors_kernel == null) 
			cooleyTukeyFFTTwiddleFactors_kernel = createKernel("cooleyTukeyFFTTwiddleFactors");
		cooleyTukeyFFTTwiddleFactors_kernel.setArgs(N, twiddleFactors);
		return cooleyTukeyFFTTwiddleFactors_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
	CLKernel cooleyTukeyFFT_kernel;
	public synchronized CLEvent cooleyTukeyFFT(CLQueue commandQueue, CLBuffer Y, int N, CLBuffer twiddleFactors, int inverse, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException {
		if (cooleyTukeyFFT_kernel == null) 
			cooleyTukeyFFT_kernel = createKernel("cooleyTukeyFFT");
		cooleyTukeyFFT_kernel.setArgs(Y, N, twiddleFactors, inverse);
		return cooleyTukeyFFT_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy