public synchronized CLEvent cooleyTukeyFFTTwiddleFactors(CLQueue commandQueue, int N, CLBuffer<Double > 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 transposeDouble(CLQueue commandQueue, CLBuffer<Double > a, int aRows, int aColumns, CLBuffer<Double > out, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((transposeDouble_kernel == null)) transposeDouble_kernel = createKernel("transposeDouble"); transposeDouble_kernel.setArgs(a, aRows, aColumns, out); return transposeDouble_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } CLKernel mulMatFloat_kernel;
public synchronized CLEvent gen_numbers(CLQueue commandQueue, CLBuffer<Integer > seeds, CLBuffer<Integer > output, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((gen_numbers_kernel == null)) gen_numbers_kernel = createKernel("gen_numbers"); gen_numbers_kernel.setArgs(seeds, output); return gen_numbers_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } /** <i>native declaration : com/nativelibs4java/opencl/util/XORShiftRandom.c</i> */
public synchronized CLEvent mulMatDouble(CLQueue commandQueue, CLBuffer<Double > a, int aColumns, CLBuffer<Double > b, int bColumns, CLBuffer<Double > c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((mulMatDouble_kernel == null)) mulMatDouble_kernel = createKernel("mulMatDouble"); mulMatDouble_kernel.setArgs(a, aColumns, b, bColumns, c); return mulMatDouble_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } CLKernel mulVecDouble_kernel;
public synchronized CLEvent transposeFloat(CLQueue commandQueue, CLBuffer<Float > a, int aRows, int aColumns, CLBuffer<Float > out, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((transposeFloat_kernel == null)) transposeFloat_kernel = createKernel("transposeFloat"); transposeFloat_kernel.setArgs(a, aRows, aColumns, out); return transposeFloat_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } }
public synchronized CLEvent cooleyTukeyFFTCopy(CLQueue commandQueue, CLBuffer<Float > X, CLBuffer<Float > Y, int N, CLBuffer<Integer > 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<Float > 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<Float > Y, int N, CLBuffer<Float > 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); } }
public synchronized CLEvent simpleSobel(CLQueue commandQueue, CLBuffer<Byte > input, int width, int height, CLBuffer<Float > gradientOutput, CLBuffer<Float > directionOutput, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if (simpleSobel_kernel == null) simpleSobel_kernel = createKernel("simpleSobel"); simpleSobel_kernel.setArgs(input, width, height, gradientOutput, directionOutput); return simpleSobel_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } CLKernel normalizeImage_kernel;
public synchronized CLEvent dft(CLQueue commandQueue, CLBuffer<Float > in, CLBuffer<Float > 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); } }
public synchronized CLEvent mulVecFloat(CLQueue commandQueue, CLBuffer<Float > a, int aColumns, CLBuffer<Float > b, int bSize, CLBuffer<Float > c, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((mulVecFloat_kernel == null)) mulVecFloat_kernel = createKernel("mulVecFloat"); mulVecFloat_kernel.setArgs(a, aColumns, b, bSize, c); return mulVecFloat_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } CLKernel transposeFloat_kernel;
public synchronized CLEvent normalizeImage(CLQueue commandQueue, CLBuffer<Float > input, float maxValue, CLBuffer<Byte > output, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if (normalizeImage_kernel == null) normalizeImage_kernel = createKernel("normalizeImage"); normalizeImage_kernel.setArgs(input, maxValue, output); return normalizeImage_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } /// <i>native declaration : com/nativelibs4java/opencl/demos/sobelfilter/SimpleSobel.cl</i>
public synchronized CLEvent normalizeImage(CLQueue commandQueue, CLBuffer<Float > input, float maxValue, CLBuffer<Byte > output, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((normalizeImage_kernel == null)) normalizeImage_kernel = createKernel("normalizeImage"); normalizeImage_kernel.setArgs(input, maxValue, output); return normalizeImage_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } /** <i>native declaration : com/nativelibs4java/opencl/demos/sobelfilter/SimpleSobel.cl</i> */
public <T> CLEvent op1(Primitive prim, Fun1 fun, CLBuffer<T> a, long rows, long columns, long stride, CLBuffer<T> out, CLEvent... eventsToWaitFor) throws CLBuildException { long length = rows * stride; if (out == null || out.getElementCount() < length) throw new IllegalArgumentException("Expected buffer of length >= " + length + ", got " + out); //if (out != null) // out = (CLBuffer<T>)context.createBuffer(Usage.Output, prim.primitiveType, length); CLKernel kernel = math.getKernel(fun, prim); synchronized (kernel) { kernel.setArgs(a, out, length); CLEvent evt = kernel.enqueueNDRange(queue, new int [] { (int)length }, eventsToWaitFor); return evt; } }
public synchronized CLEvent HSVAtoRGBA(CLQueue commandQueue, float hsva[], int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((HSVAtoRGBA_kernel == null)) HSVAtoRGBA_kernel = createKernel("HSVAtoRGBA"); checkArrayLength(hsva, 4, "hsva"); HSVAtoRGBA_kernel.setArgs(hsva); return HSVAtoRGBA_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } }
private synchronized CLEvent process(CLKernel kernel, CLQueue queue, CLImage2D in1, CLImage2D in2, CLImage2D out) { kernel.setArgs(in1, in2, out); return kernel.enqueueNDRange(queue, new int[] {(int) in1.getWidth(), (int) in1.getHeight()}); }
public synchronized CLEvent rotateValue2(CLQueue commandQueue, double value[], double sinCos[], int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((rotateValue2_kernel == null)) rotateValue2_kernel = createKernel("rotateValue2"); checkArrayLength(value, 2, "value"); checkArrayLength(sinCos, 2, "sinCos"); rotateValue2_kernel.setArgs(value, sinCos); return rotateValue2_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } CLKernel cooleyTukeyFFTCopy_kernel;
public synchronized CLEvent mandelbrot(CLQueue commandQueue, float delta[], float minimum[], int maxIter, int magicNumber, int hRes, CLBuffer<Integer > outputi, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if (mandelbrot_kernel == null) mandelbrot_kernel = createKernel("mandelbrot"); checkArrayLength(delta, 2, "delta"); checkArrayLength(minimum, 2, "minimum"); mandelbrot_kernel.setArgs(delta, minimum, maxIter, magicNumber, hRes, outputi); return mandelbrot_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } }
public synchronized CLEvent mandelbrot(CLQueue commandQueue, float delta[], float minimum[], int maxIter, int magicNumber, int hRes, CLBuffer<Integer > outputi, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((mandelbrot_kernel == null)) mandelbrot_kernel = createKernel("mandelbrot"); checkArrayLength(delta, 2, "delta"); checkArrayLength(minimum, 2, "minimum"); mandelbrot_kernel.setArgs(delta, minimum, maxIter, magicNumber, hRes, outputi); return mandelbrot_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } }
public synchronized CLEvent g(CLQueue commandQueue, float floats[], CLBuffer<Float > out, int globalWorkSizes[], int localWorkSizes[], CLEvent... eventsToWaitFor) throws CLBuildException { if ((g_kernel == null)) g_kernel = createKernel("g"); checkArrayLength(floats, 3, "floats"); g_kernel.setArgs(floats, out); return g_kernel.enqueueNDRange(commandQueue, globalWorkSizes, localWorkSizes, eventsToWaitFor); } }