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 DoubleDFTProgram */ 012public class DoubleDFTProgram extends CLAbstractUserProgram { 013 public DoubleDFTProgram(CLContext context) throws IOException { 014 super(context, readRawSourceForClass(DoubleDFTProgram.class)); 015 } 016 public DoubleDFTProgram(CLProgram program) throws IOException { 017 super(program, readRawSourceForClass(DoubleDFTProgram.class)); 018 } 019 CLKernel dft_kernel; 020 public synchronized CLEvent dft(CLQueue commandQueue, CLBuffer<Double > in, CLBuffer<Double > 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}