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

com.nativelibs4java.opencl.util.fft.FloatDFT 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.*;
import com.nativelibs4java.opencl.CLPlatform.DeviceFeature;
import com.nativelibs4java.util.*;
import java.io.File;
import java.io.IOException;
import java.nio.FloatBuffer;

/**
 * Slow OpenCL Fourier Transform that works in all cases (simple precision floating point numbers)
 */
public class FloatDFT extends AbstractDFT {

    final FloatDFTProgram program;

    public FloatDFT(CLContext context) throws IOException, CLException {
        super(context, Float.class);
        program = new FloatDFTProgram(context);
    }
    public FloatDFT() throws IOException {
        this(JavaCL.createBestContext());
    }

    @Override
    protected CLEvent dft(CLQueue queue, CLBuffer inBuf, CLBuffer outBuf, int length, int sign, int[] dims, CLEvent... events) throws CLException {
        return program.dft(queue, inBuf, outBuf, length, sign, dims, null, events);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy