 BFstatus bfFFTC2C1d(
     void** input_data, void** output_data, 
     BFsize nelements, unsigned dtype,
-    BFspace space)
+    BFspace space, int direction)
 {
     cufftComplex* idata = *((cufftComplex**)input_data);
     cufftComplex* odata = *((cufftComplex**)output_data);
     cufftHandle plan;
     cufftPlan1d(&plan, nelements, CUFFT_C2C, 1);
-    cufftExecC2C(plan, idata, odata, CUFFT_FORWARD);
+    cufftExecC2C(plan, idata, odata, direction);
     return BF_STATUS_SUCCESS;
 }
 

        return bfFFTC2C1d(
            (void**)&(input->data), (void**)&(output->data),
            input->shape[0], input->dtype,
            input->space);
    else if(input->ndim == 2)
        return bfFFTC2C2d(
            (void**)&(input->data), (void**)&(output->data),
            input->shape[0], input->shape[1], input->dtype,
            input->space);
    return BF_STATUS_INTERNAL_ERROR;
}


#if BF_CUDA_ENABLED
    #include "cuda/stream.hpp"
    #include <cuda_runtime_api.h>
    #define FFT_FORWARD CUFFT_FORWARD
    #define FFT_INVERSE CUFFT_INVERSE
    #define FFT_C2C CUFFT_C2C 
    #define FFT_R2C CUFFT_R2C 
    #define FFT_C2R CUFFT_C2R 
#endif
#include <bifrost/common.h>
#include <bifrost/ring.h>
