001package com.nativelibs4java.opencl.util.fft; 002import com.nativelibs4java.opencl.CLAbstractUserProgram; 003import com.nativelibs4java.opencl.CLBuffer; 004import com.nativelibs4java.opencl.CLBuildException; 005import com.nativelibs4java.opencl.CLContext; 006import com.nativelibs4java.opencl.CLEvent; 007import com.nativelibs4java.opencl.CLKernel; 008import com.nativelibs4java.opencl.CLProgram; 009import com.nativelibs4java.opencl.CLQueue; 010import java.io.IOException; 011/** Wrapper around the OpenCL program FloatDFTProgram */ 012public class FloatDFTProgram extends CLAbstractUserProgram { 013 public FloatDFTProgram(CLContext context) throws IOException { 014 super(context, readRawSourceForClass(FloatDFTProgram.class)); 015 } 016 public FloatDFTProgram(CLProgram program) throws IOException { 017 super(program, readRawSourceForClass(FloatDFTProgram.class)); 018 } 019 CLKernel dft_kernel; 020 public synchronized CLEvent dft(CLQueue commandQueue, CLBuffer<Float > in, CLBuffer<Float > out, int length, int sign, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { 021 if ((dft_kernel == null)) 022 dft_kernel = createKernel("dft"); 023 dft_kernel.setArgs(in, out, length, sign); 024 return dft_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); 025 } 026}