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

org.nd4j.linalg.jcublas.util.FFTUtils Maven / Gradle / Ivy

There is a newer version: 0.4-rc3.7
Show newest version
package org.nd4j.linalg.jcublas.util;

import org.nd4j.linalg.api.buffer.DataBuffer;

import jcuda.jcufft.cufftType;
import org.nd4j.linalg.api.buffer.DataBuffer;

/**
 * @author Adam Gibson
 */
public class FFTUtils {
    /**
     * Get the plan for the given buffer (C2C for float Z2Z for double)
     * @param buff the buffer to get the plan for
     * @return the plan for the given buffer
     */
    public static int getPlanFor(DataBuffer buff) {
        if(buff.dataType() == DataBuffer.Type.FLOAT)
            return cufftType.CUFFT_C2C;
        else
            return cufftType.CUFFT_Z2Z;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy